Index: lib/whitelisting.js |
=================================================================== |
--- a/lib/whitelisting.js |
+++ b/lib/whitelisting.js |
@@ -22,6 +22,7 @@ |
let {defaultMatcher} = require("matcher"); |
let {RegExpFilter} = require("filterClasses"); |
let {stringifyURL, getDecodedHostname, extractHostFromFrame, isThirdParty} = require("url"); |
+let {port} = require("messaging"); |
let devtools = require("devtools"); |
let pagesWithKey = new ext.PageMap(); |
@@ -129,6 +130,7 @@ |
urlsWithKey[stringifyURL(url)] = key; |
} |
+let processKey = |
/** |
* Validates signatures given by the "X-Adblock-Key" response |
* header or the "data-adblockkey" attribute of the document |
@@ -151,3 +153,8 @@ |
if (verifyKey(key, signature, frame.url)) |
recordKey(page, frame.url, key); |
}; |
+ |
+port.on("filters.addKey", (message, sender) => |
+{ |
+ processKey(message.token, sender.page, sender.frame); |
+}); |