From 7243aedf17ac8199250abafca20a61e23c75539f Mon Sep 17 00:00:00 2001 From: gorhill Date: Mon, 9 Mar 2015 12:57:52 -0400 Subject: [PATCH] this fixes #224 for Chromium --- platform/firefox/frameModule.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/platform/firefox/frameModule.js b/platform/firefox/frameModule.js index 3a16c70..cd513dc 100644 --- a/platform/firefox/frameModule.js +++ b/platform/firefox/frameModule.js @@ -55,6 +55,11 @@ const contentObserver = { cpMessageName: hostName + ':shouldLoad', ignoredPopups: new WeakMap(), uniqueSandboxId: 1, + subscriberTargets: { + 'adblockplus.org': true, + 'adblockplus.me': true, + 'fanboy.co.nz': true + }, get componentRegistrar() { return Components.manager.QueryInterface(Ci.nsIComponentRegistrar); @@ -295,6 +300,27 @@ const contentObserver = { }; subject.addEventListener('DOMContentLoaded', docReady, true); + +/* Does not work, I do not know why + + let docIdle = function(e) { + this.removeEventListener(e.type, docIdle); + lss(this.contentBaseURI + 'subscriber.js', sandbox); + }; + + var target = loc.host; + while ( target !== '' ) { + if ( this.subscriberTargets.hasOwnProperty(target) ) { + subject.addEventListener('load', docIdle); + break; + } + let pos = target.indexOf('.'); + if ( pos === -1 ) { + break; + } + target = target.slice(pos + 1); + } +*/ } };