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) |