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: Addressed Manish's feedback Created May 1, 2018, 10:49 a.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 244c38bb3397ff25fe9440ef7a1aeffb76f9c777..ab8c1f63b5b639335350c4425dcb70fae7d33108 100644
--- a/lib/popupBlocker.js
+++ b/lib/popupBlocker.js
@@ -24,7 +24,7 @@ const {BlockingFilter,
RegExpFilter} = require("../adblockpluscore/lib/filterClasses");
const {stringifyURL, isThirdParty, extractHostFromFrame} = require("./url");
const {checkWhitelisted} = require("./whitelisting");
-const {logRequest} = require("./devtools");
+const {logRequest} = require("./hitLogger");
let loadingPopups = new Map();
@@ -45,8 +45,8 @@ function checkPotentialPopup(tabId, popup)
{
let urlObj = new URL(popup.url || "about:blank");
let urlString = stringifyURL(urlObj);
- let documentHost = extractHostFromFrame(popup.sourceFrame);
- let thirdParty = isThirdParty(urlObj, documentHost);
+ let docDomain = extractHostFromFrame(popup.sourceFrame);
+ let thirdParty = isThirdParty(urlObj, docDomain);
let specificOnly = !!checkWhitelisted(
popup.sourcePage, popup.sourceFrame, null,
@@ -55,16 +55,16 @@ function checkPotentialPopup(tabId, popup)
let filter = defaultMatcher.matchesAny(
urlString, RegExpFilter.typeMap.POPUP,
- documentHost, thirdParty, null, specificOnly
+ docDomain, thirdParty, null, specificOnly
);
if (filter instanceof BlockingFilter)
browser.tabs.remove(tabId);
logRequest(
- [popup.sourcePage.id], urlString, "POPUP",
- documentHost, thirdParty, null,
- specificOnly, filter
+ [popup.sourcePage.id],
+ {url: urlString, type: "POPUP", docDomain, thirdParty, specificOnly},
+ filter
);
}
« lib/hitLogger.js ('K') | « lib/hitLogger.js ('k') | lib/requestBlocker.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld