Index: chrome/ext/background.js |
diff --git a/chrome/ext/background.js b/chrome/ext/background.js |
index 0baea123e912d64275646f377d42391f494fa50e..35b7c72b1b1d2dcb5ab42fb1102c8bf285da81db 100644 |
--- a/chrome/ext/background.js |
+++ b/chrome/ext/background.js |
@@ -130,13 +130,13 @@ |
frame.parent = framesOfTabs[details.tabId][details.parentFrameId] || null; |
}); |
- chrome.webNavigation.onCommitted.addListener(function(details) |
+ ext._updatePageFrameStructure = function(frameId, tabId, url) |
{ |
- if (details.frameId == 0) |
+ if (frameId == 0) |
{ |
- ext._removeFromAllPageMaps(details.tabId); |
+ ext._removeFromAllPageMaps(tabId); |
- chrome.tabs.get(details.tabId, function() |
+ chrome.tabs.get(tabId, function() |
{ |
// If the tab is prerendered, chrome.tabs.get() sets |
// chrome.runtime.lastError and we have to dispatch the onLoading event, |
@@ -148,8 +148,8 @@ |
{ |
ext.pages.onLoading._dispatch( |
new Page({ |
- id: details.tabId, |
- url: details.url |
+ id: tabId, |
+ url: url |
}) |
); |
} |
@@ -157,8 +157,13 @@ |
} |
// Update frame URL in frame structure |
- var frame = createFrame(details.tabId, details.frameId); |
- frame.url = new URL(details.url); |
+ var frame = createFrame(tabId, frameId); |
+ frame.url = new URL(url); |
+ }; |
+ |
+ chrome.webNavigation.onCommitted.addListener(function(details) |
+ { |
+ ext._updatePageFrameStructure(details.frameId, details.tabId, details.url); |
}); |
function forgetTab(tabId) |