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

Unified Diff: lib/whitelisting.js

Issue 29321504: Issue 2738 - Pass bit masks to matching functions (Closed)
Patch Set: Created July 9, 2015, 2:50 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
Index: lib/whitelisting.js
diff --git a/lib/whitelisting.js b/lib/whitelisting.js
index 129e775847c2229e272be68113210d439ef32fb4..3bf6a70a3af79812cb2daba95363d89aadcc7f3b 100644
--- a/lib/whitelisting.js
+++ b/lib/whitelisting.js
@@ -18,6 +18,7 @@
/** @module whitelisting */
let {defaultMatcher} = require("matcher");
+let {RegExpFilter} = require("filterClasses");
let {stringifyURL, getDecodedHostname, extractHostFromFrame, isThirdParty} = require("url");
let pagesWithKey = new ext.PageMap();
@@ -33,7 +34,7 @@ exports.isPageWhitelisted = function(page)
let url = page.url;
return defaultMatcher.whitelist.matchesAny(
- stringifyURL(url), "DOCUMENT",
+ stringifyURL(url), RegExpFilter.toTypeMask("DOCUMENT"),
getDecodedHostname(url), false, null
);
};
@@ -56,7 +57,7 @@ exports.isFrameWhitelisted = function(page, frame, type)
let documentHost = extractHostFromFrame(parent) || getDecodedHostname(url);
let filter = defaultMatcher.whitelist.matchesAny(
- stringifyURL(url), type || "DOCUMENT",
+ stringifyURL(url), RegExpFilter.toTypeMask(type || "DOCUMENT"),
Sebastian Noack 2015/07/09 15:28:52 And here as well.
kzar 2015/07/12 14:28:01 Done.
documentHost, isThirdParty(url, documentHost),
getKey(page, frame)
);
« lib/filterComposer.js ('K') | « lib/filterComposer.js ('k') | popupBlocker.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld