Index: lib/requestBlocker.js |
=================================================================== |
--- a/lib/requestBlocker.js |
+++ b/lib/requestBlocker.js |
@@ -73,21 +73,20 @@ |
yield "CSP"; |
}()); |
-function onBeforeRequestAsync(page, url, type, docDomain, |
+function onBeforeRequestAsync(tabId, url, type, docDomain, |
thirdParty, sitekey, |
specificOnly, filter) |
{ |
- if (filter) |
- FilterNotifier.emit("filter.hitCount", filter, 0, 0, page); |
+ let tabIds = tabId != -1 ? [tabId] : []; |
- if (devtools) |
- { |
- devtools.logRequest( |
- page, url, type, docDomain, |
- thirdParty, sitekey, |
- specificOnly, filter |
- ); |
- } |
+ if (filter) |
+ FilterNotifier.emit("filter.hitCount", filter, 0, 0, tabIds); |
+ |
+ devtools.logRequest( |
+ tabIds, url, type, docDomain, |
+ thirdParty, sitekey, |
+ specificOnly, filter |
+ ); |
} |
browser.webRequest.onBeforeRequest.addListener(details => |
@@ -125,7 +124,6 @@ |
details.type == "sub_frame" ? details.parentFrameId : details.frameId |
); |
- let page = null; |
let docDomain = null; |
let sitekey = null; |
let thirdParty = false; |
@@ -133,7 +131,7 @@ |
if (frame) |
{ |
- page = new ext.Page({id: details.tabId}); |
+ let page = new ext.Page({id: details.tabId}); |
if (checkWhitelisted(page, frame)) |
return; |
@@ -152,7 +150,7 @@ |
docDomain, thirdParty, sitekey, specificOnly |
); |
- setTimeout(onBeforeRequestAsync, 0, page, urlString, |
+ setTimeout(onBeforeRequestAsync, 0, details.tabId, urlString, |
type, docDomain, |
thirdParty, sitekey, |
specificOnly, filter); |