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

Unified Diff: chrome/ext/background.js

Issue 5943816674607104: Issue 1983 - Dispatch onLoading event for prerendered pages (Closed)
Patch Set: Don't remove entry from framesOfTab Created Feb. 10, 2015, 12:42 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: chrome/ext/background.js
===================================================================
--- a/chrome/ext/background.js
+++ b/chrome/ext/background.js
@@ -102,10 +102,13 @@
onLoading: new ext._EventTarget()
};
- chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab)
+ chrome.webNavigation.onBeforeNavigate.addListener(function(details)
{
- if (changeInfo.status == "loading")
- ext.pages.onLoading._dispatch(new Page(tab));
+ if (details.frameId == 0)
+ {
+ ext._removeFromAllPageMaps(details.tabId);
+ ext.pages.onLoading._dispatch(new Page({id: details.tabId, url: details.url}));
+ }
});
function forgetTab(tabId)
@@ -114,12 +117,6 @@
delete framesOfTabs[tabId];
}
- chrome.webNavigation.onBeforeNavigate.addListener(function(details)
- {
- if (details.frameId == 0)
- forgetTab(details.tabId);
- });
-
chrome.tabs.onReplaced.addListener(function(addedTabId, removedTabId)
{
forgetTab(removedTabId);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld