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; |