Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: lib/whitelisting.js

Issue 29338491: Issue 3823 - Split up message responder code (Closed)
Patch Set: Use require() inline Created March 21, 2016, 7:53 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/messaging.js ('k') | metadata.common » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
+});
« no previous file with comments | « lib/messaging.js ('k') | metadata.common » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld