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

Unified Diff: chrome/ext/background.js

Issue 29357576: Issue 4483 - Update page structure when sitekey is received (Closed)
Patch Set: Created Oct. 17, 2016, 10:16 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 | « no previous file | lib/whitelisting.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« no previous file with comments | « no previous file | lib/whitelisting.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld