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

Unified Diff: lib/requestBlocker.js

Issue 29737602: Issue 4580 - Make filter/request logging use plain tabIds, prepare for multi-tab requests (Closed)
Patch Set: Removed outdated comment Created April 4, 2018, 1:48 a.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
« no previous file with comments | « lib/popupBlocker.js ('k') | lib/stats.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « lib/popupBlocker.js ('k') | lib/stats.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld