Index: lib/whitelisting.js |
=================================================================== |
--- a/lib/whitelisting.js |
+++ b/lib/whitelisting.js |
@@ -21,6 +21,7 @@ |
let {defaultMatcher} = require("matcher"); |
let {RegExpFilter} = require("filterClasses"); |
+let {FilterNotifier} = require("filterNotifier"); |
let {stringifyURL, getDecodedHostname, extractHostFromFrame, isThirdParty} = require("url"); |
let {port} = require("messaging"); |
let devtools = require("devtools"); |
@@ -47,6 +48,7 @@ |
return filter; |
} |
+let checkWhitelisted = |
/** |
* Gets the active whitelisting filter for the document associated |
* with the given page/frame, or null if it's not whitelisted. |
@@ -81,6 +83,27 @@ |
return match(page, page.url, typeMask); |
}; |
+FilterNotifier.addListener(action => |
+{ |
+ if (action == "load" || action == "save") |
+ ext.pages.query({}, pages => |
+ { |
+ for (let page of pages) |
+ FilterNotifier.triggerListeners( |
+ "page.WhitelistingStateRevalidate", |
+ page, checkWhitelisted(page) |
+ ); |
+ }); |
+}); |
+ |
+ext.pages.onLoading.addListener(page => |
+{ |
+ FilterNotifier.triggerListeners( |
+ "page.WhitelistingStateRevalidate", |
+ page, checkWhitelisted(page) |
+ ); |
+}); |
+ |
let getKey = |
/** |
* Gets the public key, previously recorded for the given page |