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:
		
							parent
							
								
									5a5512aa0f
								
							
						
					
					
						commit
						595b037ab1
					
				| 
						 | 
					@ -77,7 +77,7 @@ const URLS = {
 | 
				
			||||||
    RegExp.$1,
 | 
					    RegExp.$1,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  supported: url => (
 | 
					  supported: url => (
 | 
				
			||||||
    url.startsWith('http') && (FIREFOX || !url.startsWith(URLS.browserWebStore)) ||
 | 
					    url.startsWith('http') ||
 | 
				
			||||||
    url.startsWith('ftp') ||
 | 
					    url.startsWith('ftp') ||
 | 
				
			||||||
    url.startsWith('file') ||
 | 
					    url.startsWith('file') ||
 | 
				
			||||||
    url.startsWith(URLS.ownOrigin) ||
 | 
					    url.startsWith(URLS.ownOrigin) ||
 | 
				
			||||||
| 
						 | 
					@ -85,26 +85,13 @@ const URLS = {
 | 
				
			||||||
  ),
 | 
					  ),
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const IS_BG = chrome.extension.getBackgroundPage && chrome.extension.getBackgroundPage() === window;
 | 
					if (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) {
 | 
					 | 
				
			||||||
  window.API_METHODS = {};
 | 
					  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({
 | 
					promisifyChrome({
 | 
				
			||||||
  tabs: ['create', 'get', 'getCurrent', 'move', 'query', 'update'],
 | 
					  tabs: ['create', 'get', 'getCurrent', 'move', 'query', 'update'],
 | 
				
			||||||
  windows: ['create', 'update'], // Android doesn't have chrome.windows
 | 
					  windows: ['create', 'update'], // Android doesn't have chrome.windows
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user