diff --git a/platform/firefox/frameModule.js b/platform/firefox/frameModule.js index 24bc3a6c3..c773a5160 100644 --- a/platform/firefox/frameModule.js +++ b/platform/firefox/frameModule.js @@ -33,7 +33,8 @@ const {XPCOMUtils} = Cu.import('resource://gre/modules/XPCOMUtils.jsm', null); const hostName = Services.io.newURI(Components.stack.filename, null, null).host; const rpcEmitterName = hostName + ':child-process-message'; -//Cu.import('resource://gre/modules/Console.jsm'); +//Cu.import('resource://gre/modules/Console.jsm'); // Firefox >= 44 +//Cu.import('resource://gre/modules/devtools/Console.jsm'); // Firefox < 44 /******************************************************************************/ diff --git a/platform/firefox/frameScript.js b/platform/firefox/frameScript.js index 17cd84f2f..b1a908fde 100644 --- a/platform/firefox/frameScript.js +++ b/platform/firefox/frameScript.js @@ -34,6 +34,11 @@ let {contentObserver, LocationChangeListener} = Components.utils.import( null ); +// https://github.com/gorhill/uBlock/issues/1444 +// Apparently the same context is used for all extensions, hence we must use +// scoped variables to ensure no collision. +let locationChangeListener; + let injectContentScripts = function(win) { if ( !win || !win.document ) { return; @@ -61,7 +66,7 @@ let shutdown = function(ev) { } context.removeMessageListener('ublock0-load-completed', onLoadCompleted); context.removeEventListener('unload', shutdown); - context.locationChangeListener = null; + locationChangeListener = null; LocationChangeListener = null; contentObserver = null; }; @@ -74,7 +79,7 @@ if ( context.docShell ) { let dw = wp.DOMWindow; if ( dw === dw.top ) { - context.locationChangeListener = new LocationChangeListener(context.docShell); + locationChangeListener = new LocationChangeListener(context.docShell); } }