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

Unified Diff: lib/devtools.js

Issue 29418679: Issue 5042 - Adds handling for requests which are not associated with browser tab (Closed)
Patch Set: Created April 20, 2017, 9:43 p.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
Index: lib/devtools.js
===================================================================
--- a/lib/devtools.js
+++ b/lib/devtools.js
@@ -131,22 +131,26 @@
* @param {?boolean} specificOnly Whether generic filters should be ignored
* @param {?BlockingFilter} filter The matched filter or null if there is no
* match
*/
exports.logRequest = function(page, url, type, docDomain,
thirdParty, sitekey,
specificOnly, filter)
{
- let panel = getActivePanel(page);
- if (panel)
+ let request = {url, type, docDomain, thirdParty, sitekey, specificOnly};
Sebastian Noack 2017/04/21 08:39:53 Perhaps, we should bail if there are no panels, be
Jon Sonesen 2017/04/24 08:40:56 Acknowledged.
+ if (page)
{
- let request = {url, type, docDomain, thirdParty, sitekey, specificOnly};
- addRecord(panel, request, filter);
+ let panel = getActivePanel(page);
+ if (panel)
+ addRecord(panel, request, filter);
+ return;
}
+ for (let panelId in panels)
Sebastian Noack 2017/04/21 08:39:53 Some of the code added here, and in this file in g
Jon Sonesen 2017/04/24 08:40:56 Awesome, I agree here. I am wondering though, shou
+ addRecord(panels[panelId], request, filter);
Sebastian Noack 2017/04/21 08:39:53 getActivePanel(), called when logging for a specif
Jon Sonesen 2017/04/24 08:40:56 Acknowledged.
};
/**
* Logs active element hiding filters to the devtools panel.
*
* @param {Page} page The page the elements were hidden on
* @param {string[]} selectors The selectors of applied ElemHideFilters
* @param {string[]} filters The text of applied ElemHideEmulationFilters

Powered by Google App Engine
This is Rietveld