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

Unified Diff: lib/requestBlocker.js

Issue 29705719: Issue 6402 - Split filter hit / request logging out into own API (Closed)
Patch Set: Addressed Sebastian's feedback Created March 21, 2018, 3:14 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/requestBlocker.js
diff --git a/lib/requestBlocker.js b/lib/requestBlocker.js
index 56f6313cea25fe63ebfef2c5b0498a70f989117b..0754319c1623aad91d8a2e1afd38ad6d911c7459 100644
--- a/lib/requestBlocker.js
+++ b/lib/requestBlocker.js
@@ -27,7 +27,7 @@ const {Prefs} = require("prefs");
const {checkWhitelisted, getKey} = require("whitelisting");
const {stringifyURL, extractHostFromFrame, isThirdParty} = require("url");
const {port} = require("messaging");
-const devtools = require("devtools");
+const {logRequest} = require("hitLogger");
// Chrome can't distinguish between OBJECT_SUBREQUEST and OBJECT requests.
if (!browser.webRequest.ResourceType ||
@@ -81,14 +81,11 @@ function onBeforeRequestAsync(page, url, type, docDomain,
if (filter)
FilterNotifier.emit("filter.hitCount", filter, 0, 0, page);
- if (devtools)
- {
- devtools.logRequest(
- page, url, type, docDomain,
- thirdParty, sitekey,
- specificOnly, filter
- );
- }
+ logRequest(
+ page ? page.id : -1, url, type, docDomain,
+ thirdParty, sitekey,
+ specificOnly, filter
+ );
}
ext.webRequest.onBeforeRequest.addListener((url, type, page, frame) =>
« lib/hitLogger.js ('K') | « lib/popupBlocker.js ('k') | lib/whitelisting.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld