Index: lib/whitelisting.js |
=================================================================== |
--- a/lib/whitelisting.js |
+++ b/lib/whitelisting.js |
@@ -23,8 +23,7 @@ |
const {Filter, RegExpFilter} = require("../adblockpluscore/lib/filterClasses"); |
const {FilterNotifier} = require("../adblockpluscore/lib/filterNotifier"); |
const {FilterStorage} = require("../adblockpluscore/lib/filterStorage"); |
-const {stringifyURL, getDecodedHostname, |
- extractHostFromFrame, isThirdParty} = require("./url"); |
+const {extractHostFromFrame, isThirdParty} = require("./url"); |
const {port} = require("./messaging"); |
const {logWhitelistedDocument} = require("./devtools"); |
const {verifySignature} = require("../adblockpluscore/lib/rsa"); |
@@ -34,17 +33,16 @@ |
function match(page, url, typeMask, docDomain, sitekey) |
{ |
let thirdParty = !!docDomain && isThirdParty(url, docDomain); |
- let urlString = stringifyURL(url); |
if (!docDomain) |
- docDomain = getDecodedHostname(url); |
+ docDomain = url.hostname; |
let filter = defaultMatcher.whitelist.matchesAny( |
- urlString, typeMask, docDomain, thirdParty, sitekey |
+ url.href, typeMask, docDomain, thirdParty, sitekey |
); |
if (filter && page) |
- logWhitelistedDocument(page.id, urlString, typeMask, docDomain, filter); |
+ logWhitelistedDocument(page.id, url.href, typeMask, docDomain, filter); |
return filter; |
} |
@@ -93,7 +91,7 @@ |
port.on("filters.whitelist", message => |
{ |
let page = new ext.Page(message.tab); |
- let host = getDecodedHostname(page.url).replace(/^www\./, ""); |
+ let host = page.url.hostname.replace(/^www\./, ""); |
let filter = Filter.fromText("@@||" + host + "^$document"); |
if (filter.subscriptions.length && filter.disabled) |
{ |
@@ -158,7 +156,7 @@ |
{ |
for (; frame; frame = frame.parent) |
{ |
- let key = keys.get(stringifyURL(frame.url)); |
+ let key = keys.get(frame.url.href); |
if (key) |
return key; |
} |
@@ -169,7 +167,7 @@ |
{ |
for (let keys of sitekeys._map.values()) |
{ |
- let key = keys.get(stringifyURL(originUrl)); |
+ let key = keys.get(originUrl.href); |
if (key) |
return key; |
} |
@@ -203,7 +201,7 @@ |
keys = new Map(); |
sitekeys.set(page, keys); |
} |
- keys.set(stringifyURL(url), key); |
+ keys.set(url.href, key); |
} |
port.on("filters.addKey", (message, sender) => |