From 3f570c4d3a5db1ec65c113e07d867a55895c2ca8 Mon Sep 17 00:00:00 2001 From: tophf Date: Wed, 3 Jan 2018 10:37:54 +0300 Subject: [PATCH] FF injects content script automatically --- background/background.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/background/background.js b/background/background.js index 3d7224df..e2e162dd 100644 --- a/background/background.js +++ b/background/background.js @@ -202,6 +202,9 @@ window.addEventListener('storageReady', function _() { styles: {}, }); + // Firefox injects content script automatically + if (FIREFOX) return; + const NTP = 'chrome://newtab/'; const ALL_URLS = ''; const contentScripts = chrome.runtime.getManifest().content_scripts; @@ -238,7 +241,7 @@ window.addEventListener('storageReady', function _() { queryTabs().then(tabs => tabs.forEach(tab => { // skip lazy-loaded aka unloaded tabs that seem to start loading on message in FF - if (!FIREFOX || tab.width) { + if (tab.width) { contentScripts.forEach(cs => setTimeout(pingCS, 0, cs, tab)); }