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

Unified Diff: lib/popupBlocker.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/options.js ('k') | lib/punycode.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/popupBlocker.js
===================================================================
--- a/lib/popupBlocker.js
+++ b/lib/popupBlocker.js
@@ -22,7 +22,7 @@
const {defaultMatcher} = require("../adblockpluscore/lib/matcher");
const {BlockingFilter,
RegExpFilter} = require("../adblockpluscore/lib/filterClasses");
-const {stringifyURL, isThirdParty, extractHostFromFrame} = require("./url");
+const {isThirdParty, extractHostFromFrame} = require("./url");
const {checkWhitelisted} = require("./whitelisting");
const {logRequest} = require("./devtools");
@@ -43,10 +43,9 @@
function checkPotentialPopup(tabId, popup)
{
- let urlObj = new URL(popup.url || "about:blank");
- let urlString = stringifyURL(urlObj);
+ let url = popup.url || "about:blank";
let documentHost = extractHostFromFrame(popup.sourceFrame);
- let thirdParty = isThirdParty(urlObj, documentHost);
+ let thirdParty = isThirdParty(new URL(url), documentHost);
let specificOnly = !!checkWhitelisted(
popup.sourcePage, popup.sourceFrame, null,
@@ -54,7 +53,7 @@
);
let filter = defaultMatcher.matchesAny(
- urlString, RegExpFilter.typeMap.POPUP,
+ url, RegExpFilter.typeMap.POPUP,
documentHost, thirdParty, null, specificOnly
);
@@ -62,7 +61,7 @@
browser.tabs.remove(tabId);
logRequest(
- [popup.sourcePage.id], urlString, "POPUP",
+ [popup.sourcePage.id], url, "POPUP",
documentHost, thirdParty, null,
specificOnly, filter
);
« lib/options.js ('K') | « lib/options.js ('k') | lib/punycode.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld