| Index: lib/requestBlocker.js |
| diff --git a/lib/requestBlocker.js b/lib/requestBlocker.js |
| index 15719023fd8cacf9b101d2cb3078e3e993850a9d..556e9cbadd3c755195793344e2de41d9015fbc76 100644 |
| --- a/lib/requestBlocker.js |
| +++ b/lib/requestBlocker.js |
| @@ -28,7 +28,7 @@ const {Prefs} = require("./prefs"); |
| const {checkWhitelisted, getKey} = require("./whitelisting"); |
| const {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; |
| @@ -118,17 +118,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 => |
| @@ -192,8 +187,11 @@ browser.webRequest.onBeforeRequest.addListener(details => |
| getRelatedTabIds(details).then(tabIds => |
| { |
| - logRequest(tabIds, details.url, type, docDomain, |
| - thirdParty, sitekey, specificOnly, filter); |
| + logRequest( |
| + tabIds, |
| + {url: details.url, type, docDomain, thirdParty, sitekey, specificOnly}, |
| + filter |
| + ); |
| }); |
| if (filter instanceof BlockingFilter) |
| @@ -234,13 +232,15 @@ port.on("request.blockedByRTCWrapper", (msg, sender) => |
| if (checkWhitelisted(page, frame)) |
| return false; |
| + let {url} = msg; |
| let [docDomain, sitekey, specificOnly] = getDocumentInfo(page, frame); |
| - let [filter, thirdParty] = matchRequest(new URL(msg.url), |
| - "WEBRTC", docDomain, |
| + let [filter, thirdParty] = matchRequest(new URL(url), "WEBRTC", docDomain, |
| sitekey, specificOnly); |
| - |
| - logRequest([sender.page.id], msg.url, "WEBRTC", docDomain, |
| - thirdParty, sitekey, specificOnly, filter); |
| + logRequest( |
| + [sender.page.id], |
| + {url, type: "WEBRTC", docDomain, thirdParty, sitekey, specificOnly}, |
| + filter |
| + ); |
| return filter instanceof BlockingFilter; |
| }); |