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

Unified Diff: lib/requestBlocker.js

Issue 29772555: Issue 6647 - Stop converting domains from punycode to unicode (Closed)
Patch Set: Created May 6, 2018, 2:42 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
« lib/options.js ('K') | « lib/punycode.js ('k') | lib/url.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« lib/options.js ('K') | « lib/punycode.js ('k') | lib/url.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld