| Index: lib/requestBlocker.js |
| =================================================================== |
| --- a/lib/requestBlocker.js |
| +++ b/lib/requestBlocker.js |
| @@ -26,7 +26,7 @@ |
| const {FilterNotifier} = require("../adblockpluscore/lib/filterNotifier"); |
| const {Prefs} = require("./prefs"); |
| const {checkWhitelisted, getKey} = require("./whitelisting"); |
| -const {stringifyURL, extractHostFromFrame, isThirdParty} = require("./url"); |
| +const {extractHostFromFrame, isThirdParty} = require("./url"); |
| const {port} = require("./messaging"); |
| const devtools = require("./devtools"); |
| @@ -88,15 +88,11 @@ |
| function matchRequest(url, type, docDomain, sitekey, specificOnly) |
| { |
| - let urlString = stringifyURL(url); |
| let thirdParty = isThirdParty(url, docDomain); |
| - |
| - return [ |
| - defaultMatcher.matchesAny(urlString, RegExpFilter.typeMap[type], |
| - docDomain, thirdParty, sitekey, specificOnly), |
| - urlString, |
| - thirdParty |
| - ]; |
| + let filter = defaultMatcher.matchesAny(url.href, RegExpFilter.typeMap[type], |
| + docDomain, thirdParty, |
| + sitekey, specificOnly); |
| + return [filter, thirdParty]; |
| } |
| function getRelatedTabIds(details) |
| @@ -191,12 +187,12 @@ |
| let type = resourceTypes.get(details.type) || "OTHER"; |
| let [docDomain, sitekey, specificOnly] = getDocumentInfo(page, frame, |
| originUrl); |
| - let [filter, urlString, thirdParty] = matchRequest(url, type, docDomain, |
| - sitekey, specificOnly); |
| + let [filter, thirdParty] = matchRequest(url, type, docDomain, |
| + sitekey, specificOnly); |
| getRelatedTabIds(details).then(tabIds => |
| { |
| - logRequest(tabIds, urlString, type, docDomain, |
| + logRequest(tabIds, details.url, type, docDomain, |
| thirdParty, sitekey, specificOnly, filter); |
| }); |
| @@ -239,11 +235,11 @@ |
| return false; |
| let [docDomain, sitekey, specificOnly] = getDocumentInfo(page, frame); |
| - let [filter, url, thirdParty] = matchRequest(new URL(msg.url), |
| - "WEBRTC", docDomain, |
| - sitekey, specificOnly); |
| + let [filter, thirdParty] = matchRequest(new URL(msg.url), |
| + "WEBRTC", docDomain, |
| + sitekey, specificOnly); |
| - logRequest([sender.page.id], url, "WEBRTC", docDomain, |
| + logRequest([sender.page.id], msg.url, "WEBRTC", docDomain, |
| thirdParty, sitekey, specificOnly, filter); |
| return filter instanceof BlockingFilter; |