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] : []; |
kzar
2018/04/03 17:14:03
Nit: Seems like switching the order and using == w
Sebastian Noack
2018/04/04 01:50:33
If you think in numbers, yes, this way around seem
|
- 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); |