diff options
author | Einar Egilsson <einar@einaregilsson.com> | 2015-09-24 11:25:45 +0000 |
---|---|---|
committer | Einar Egilsson <einar@einaregilsson.com> | 2015-09-24 11:25:45 +0000 |
commit | 3adcb7ae1654928a8a86de4cf329dcd912bcbb33 (patch) | |
tree | 6a992508214e6d6a31af400e5ff8a192203e5fd0 /js/background.js | |
parent | f432a10a164e9a32f7bb915e5ca8cef5489f3ccd (diff) |
3.0.1. Fix Firefox disabling issues, simplify the chrome api shim, make things a bit more robust
Diffstat (limited to 'js/background.js')
-rw-r--r-- | js/background.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/js/background.js b/js/background.js index a87293a..e66be8f 100644 --- a/js/background.js +++ b/js/background.js @@ -12,14 +12,17 @@ log.enabled = false; var isFirefox = false; if (typeof chrome == 'undefined') { + console.log('Creating fake chrome...'); isFirefox = true; var firefoxShim = require('./firefox/background-shim'); chrome = firefoxShim.chrome; Redirect = firefoxShim.Redirect; log = firefoxShim.log; exports.onUnload = function (reason) { + log('Unloading (' + reason + '), removing listeners'); redirectEvent.removeListener(checkRedirects); chrome.storage.onChanged.removeListener(monitorChanges); + chrome.storage.clearCache(); //<-Firefox specific }; } //Hopefully Firefox will fix this at some point and we can just use onBeforeRequest everywhere... @@ -193,7 +196,6 @@ function setUpRedirectListener() { chrome.storage.local.get({redirects:[]}, function(obj) { var redirects = obj.redirects; - if (redirects.length == 0) { log('No redirects defined, not setting up listener'); return; |