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

Unified Diff: webrequest.js

Issue 28067007: Construct frame hierarchy using first request originating from it (Closed)
Patch Set: Created Nov. 6, 2013, 2:33 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrequest.js
===================================================================
--- a/webrequest.js
+++ b/webrequest.js
@@ -65,8 +65,9 @@
if (details.frameId == 0 && !(details.tabId in frames) && type == "object")
type = "main_frame";
- if (type == "main_frame" || type == "sub_frame")
- recordFrame(details.tabId, details.frameId, details.parentFrameId, details.url);
+ var isFrame = (type == "main_frame" || type == "sub_frame");
+ if (!(details.tabId in frames && details.frameId in frames[details.tabId]))
+ recordFrame(details.tabId, details.frameId, details.parentFrameId, isFrame ? details.url : null);
Wladimir Palant 2013/11/06 15:23:14 Frame URLs can change - a different URL can load i
if (type == "main_frame")
return {};
@@ -147,7 +148,8 @@
{
if (!(tabId in frames))
frames[tabId] = {};
- frames[tabId][frameId] = {url: frameUrl, parent: parentFrameId};
+ else if (!(frameId in frames[tabId]))
+ frames[tabId][frameId] = {url: frameUrl, parent: parentFrameId};
}
function getFrameData(tabId, frameId)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld