remove unused IS_BG and wrong AMO condition

* the user may have allowed access to AMO via about:config
* the code was wrong anyway, should be `!FIREFOX`
This commit is contained in:
tophf 2020-10-23 13:36:38 +03:00
parent 5a5512aa0f
commit 595b037ab1

View File

@ -77,7 +77,7 @@ const URLS = {
RegExp.$1,
supported: url => (
url.startsWith('http') && (FIREFOX || !url.startsWith(URLS.browserWebStore)) ||
url.startsWith('http') ||
url.startsWith('ftp') ||
url.startsWith('file') ||
url.startsWith(URLS.ownOrigin) ||
@ -85,26 +85,13 @@ const URLS = {
),
};
const IS_BG = chrome.extension.getBackgroundPage && chrome.extension.getBackgroundPage() === window;
if (!IS_BG) {
if (FIREFOX) {
document.documentElement.classList.add('firefox');
} else if (OPERA) {
document.documentElement.classList.add('opera');
} else {
if (VIVALDI) document.documentElement.classList.add('vivaldi');
}
}
if (IS_BG) {
if (chrome.extension.getBackgroundPage && chrome.extension.getBackgroundPage() === window) {
window.API_METHODS = {};
} else {
const cls = FIREFOX ? 'firefox' : OPERA ? 'opera' : VIVALDI ? 'vivaldi' : '';
if (cls) document.documentElement.classList.add(cls);
}
// FIXME: `localStorage` and `sessionStorage` may be disabled via dom.storage.enabled
// Object.defineProperty(window, 'localStorage', {value: {}});
// Object.defineProperty(window, 'sessionStorage', {value: {}});
promisifyChrome({
tabs: ['create', 'get', 'getCurrent', 'move', 'query', 'update'],
windows: ['create', 'update'], // Android doesn't have chrome.windows