Index: lib/requestBlocker.js |
diff --git a/lib/requestBlocker.js b/lib/requestBlocker.js |
index 40becb7da9e2a0be670288122aa257844d55feac..e538d52935a40db27409a3887096e943955deaa3 100644 |
--- a/lib/requestBlocker.js |
+++ b/lib/requestBlocker.js |
@@ -28,7 +28,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: hitLoggerLogRequest} = require("./hitLogger"); |
const extensionProtocol = new URL(browser.extension.getURL("")).protocol; |
@@ -122,17 +122,12 @@ function getRelatedTabIds(details) |
return browser.tabs.query({url}).then(tabs => tabs.map(tab => tab.id)); |
} |
-function logRequest(tabIds, url, type, docDomain, thirdParty, |
- sitekey, specificOnly, filter) |
+function logRequest(tabIds, request, filter) |
{ |
if (filter) |
FilterNotifier.emit("filter.hitCount", filter, 0, 0, tabIds); |
- devtools.logRequest( |
- tabIds, url, type, docDomain, |
- thirdParty, sitekey, |
- specificOnly, filter |
- ); |
+ hitLoggerLogRequest(tabIds, request, filter); |
} |
browser.webRequest.onBeforeRequest.addListener(details => |
@@ -196,8 +191,11 @@ browser.webRequest.onBeforeRequest.addListener(details => |
getRelatedTabIds(details).then(tabIds => |
{ |
- logRequest(tabIds, urlString, type, docDomain, |
- thirdParty, sitekey, specificOnly, filter); |
+ logRequest( |
+ tabIds, |
+ {url: urlString, type, docDomain, thirdParty, sitekey, specificOnly}, |
+ filter |
+ ); |
}); |
if (filter instanceof BlockingFilter) |
@@ -243,8 +241,11 @@ port.on("request.blockedByRTCWrapper", (msg, sender) => |
"WEBRTC", docDomain, |
sitekey, specificOnly); |
- logRequest([sender.page.id], url, "WEBRTC", docDomain, |
- thirdParty, sitekey, specificOnly, filter); |
+ logRequest( |
+ [sender.page.id], |
+ {url, type: "WEBRTC", docDomain, thirdParty, sitekey, specificOnly}, |
+ filter |
+ ); |
return filter instanceof BlockingFilter; |
}); |