Remove non-working OK button for Edge's options page

This commit is contained in:
ilyaigpetrov 2020-03-26 16:53:12 +00:00
parent 288183ddea
commit 0036050e14
2 changed files with 5 additions and 3 deletions

View File

@ -1,7 +1,7 @@
import Inferno from 'inferno';
import css from 'csjs-inject';
export default function getFooter() {
export default function getFooter(theState) {
const scopedCss = css`
@ -26,7 +26,7 @@ export default function getFooter() {
</section>
<footer class={scopedCss.controlRow + ' horFlex nowrap'}>
<input type="button" value={chrome.i18n.getMessage('Finish')} disabled={props.ifInputsDisabled} onClick={() => window.close()} />
<input type="button" value={chrome.i18n.getMessage('Finish')} disabled={props.ifInputsDisabled} style={{ display: theState.flags.ifInsideEdgeOptionsPage ? 'none' : 'initial' }} onClick={() => window.close()} />
<a href="https://rebrand.ly/ac-donate">{chrome.i18n.getMessage('Donate')}</a>
<a data-in-bg="false" href="../troubleshoot/index.html">
{chrome.i18n.getMessage('ProblemsQ')}

View File

@ -42,7 +42,9 @@ chrome.runtime.getBackgroundPage( (bgWindow) =>
);
winChrome.runtime.sendMessage({ currentTab, eventName: 'POPUP_OPENED' });
theState.flags.ifInsideOptionsPage = !currentTab || currentTab.url.startsWith('chrome://extensions/?options=') || currentTab.url.startsWith('about:addons');
theState.flags.ifInsideOptionsPage = !currentTab || /.*:\/\/extensions\/\?options=/g.test(currentTab.url) || currentTab.url.startsWith('about:addons');
theState.flags.ifInsideEdgeOptionsPage = theState.flags.ifInsideOptionsPage && currentTab.url.startsWith('edge://');
theState.currentTab = currentTab;
// If opened not via popup and not via options modal.