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

Unified Diff: lib/whitelisting.js

Issue 5733398375038976: Issue 2132 - Only match exception rules when checking whether a page/frame is whitelisted (Closed)
Patch Set: Created March 12, 2015, 7:33 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/filterComposer.js ('k') | no next file » | 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
@@ -16,7 +16,6 @@
*/
let {defaultMatcher} = require("matcher");
-let {WhitelistFilter} = require("filterClasses");
let {stringifyURL, getDecodedHostname, extractHostFromFrame, isThirdParty} = require("url");
let pagesWithKey = new ext.PageMap();
@@ -30,12 +29,11 @@
function isPageWhitelisted(page)
{
let url = page.url;
- let filter = defaultMatcher.matchesAny(
+
+ return defaultMatcher.whitelist.matchesAny(
stringifyURL(url), "DOCUMENT",
getDecodedHostname(url), false, null
);
-
- return (filter instanceof WhitelistFilter ? filter : null);
}
exports.isPageWhitelisted = isPageWhitelisted;
@@ -56,13 +54,13 @@
let url = frame.url;
let documentHost = extractHostFromFrame(parent) || getDecodedHostname(url);
- let filter = defaultMatcher.matchesAny(
+ let filter = defaultMatcher.whitelist.matchesAny(
stringifyURL(url), type || "DOCUMENT",
documentHost, isThirdParty(url, documentHost),
getKey(page, frame)
);
- if (filter instanceof WhitelistFilter)
+ if (filter)
return true;
frame = parent;
« no previous file with comments | « lib/filterComposer.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld