From 4d148a48ec375db2dc86f09f274bf5c3f76cce39 Mon Sep 17 00:00:00 2001 From: mrmr1993 Date: Thu, 17 Aug 2017 19:49:07 +0100 Subject: Add Utils.isFirefox This also stops the content scripts from being injected into each frame on reload (in Firefox only). They do not successfully connect to the background page, and it causes considerable lag, so we lose nothing by doing this. --- background_scripts/main.coffee | 1 + 1 file changed, 1 insertion(+) (limited to 'background_scripts') diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee index 15292ab6..412b8781 100644 --- a/background_scripts/main.coffee +++ b/background_scripts/main.coffee @@ -5,6 +5,7 @@ root = exports ? window chrome.runtime.onInstalled.addListener ({ reason }) -> # See https://developer.chrome.com/extensions/runtime#event-onInstalled return if reason in [ "chrome_update", "shared_module_update" ] + return if Utils.isFirefox() manifest = chrome.runtime.getManifest() # Content scripts loaded on every page should be in the same group. We assume it is the first. contentScripts = manifest.content_scripts[0] -- cgit v1.2.3 From 504e63cd9a833b236b3d7f87ea71d58707db8804 Mon Sep 17 00:00:00 2001 From: mrmr1993 Date: Thu, 7 Sep 2017 12:55:57 +0100 Subject: Use browser.runtime.getBrowserInfo to identify Firefox --- background_scripts/main.coffee | 1 + 1 file changed, 1 insertion(+) (limited to 'background_scripts') diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee index 412b8781..379239ae 100644 --- a/background_scripts/main.coffee +++ b/background_scripts/main.coffee @@ -311,6 +311,7 @@ Frames = isEnabledForUrl: ({request, tabId, port}) -> urlForTab[tabId] = request.url if request.frameIsFocused + request.isFirefox = Utils.isFirefox() # Update the value for Utils.isFirefox in the frontend. enabledState = Exclusions.isEnabledForUrl request.url if request.frameIsFocused -- cgit v1.2.3