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

Unified Diff: lib/popupBlocker.js

Issue 29705719: Issue 6402 - Split filter hit / request logging out into own API (Closed)
Patch Set: Another try at uploading the rebase diff Created May 9, 2018, 2:11 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
Index: lib/popupBlocker.js
diff --git a/lib/popupBlocker.js b/lib/popupBlocker.js
index ebccf1cf19fdb0443469db3e4be4d123a80e6fe1..8d212e4f4b9b99ab8a873436d010b187d17483f2 100644
--- a/lib/popupBlocker.js
+++ b/lib/popupBlocker.js
@@ -24,7 +24,7 @@ const {BlockingFilter,
RegExpFilter} = require("../adblockpluscore/lib/filterClasses");
const {isThirdParty, extractHostFromFrame} = require("./url");
const {checkWhitelisted} = require("./whitelisting");
-const {logRequest} = require("./devtools");
+const {logRequest} = require("./hitLogger");
let loadingPopups = new Map();
@@ -44,8 +44,8 @@ function forgetPopup(tabId)
function checkPotentialPopup(tabId, popup)
{
let url = popup.url || "about:blank";
- let documentHost = extractHostFromFrame(popup.sourceFrame);
- let thirdParty = isThirdParty(new URL(url), documentHost);
+ let docDomain = extractHostFromFrame(popup.sourceFrame);
Manish Jethani 2018/05/09 15:11:11 Let's keep it documentHost here?
kzar 2018/05/09 17:58:42 Done.
+ let thirdParty = isThirdParty(new URL(url), docDomain);
let specificOnly = !!checkWhitelisted(
popup.sourcePage, popup.sourceFrame, null,
@@ -54,16 +54,16 @@ function checkPotentialPopup(tabId, popup)
let filter = defaultMatcher.matchesAny(
url, RegExpFilter.typeMap.POPUP,
- documentHost, thirdParty, null, specificOnly
+ docDomain, thirdParty, null, specificOnly
);
if (filter instanceof BlockingFilter)
browser.tabs.remove(tabId);
logRequest(
- [popup.sourcePage.id], url, "POPUP",
- documentHost, thirdParty, null,
- specificOnly, filter
+ [popup.sourcePage.id],
+ {url, type: "POPUP", docDomain, thirdParty, specificOnly},
+ filter
);
}

Powered by Google App Engine
This is Rietveld