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

Unified Diff: safari/background.js

Issue 6369485355220992: Fixed reload issue in Chrome (Closed)
Patch Set: Created Nov. 15, 2013, 1:44 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 | « chrome/background.js ('k') | safari/content.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: safari/background.js
===================================================================
--- a/safari/background.js
+++ b/safari/background.js
@@ -35,6 +35,22 @@
}
};
+ var LoadingTabEventTarget = function(target)
+ {
+ WrappedEventTarget.call(this, target, "message", false);
+ };
+ LoadingTabEventTarget.prototype = {
+ __proto__: WrappedEventTarget.prototype,
+ _wrapListener: function(listener)
+ {
+ return function (event)
+ {
+ if (event.name == "loading" && event.message == event.target.url)
+ listener(new Tab(event.target));
+ };
+ }
+ };
+
Tab = function(tab)
{
this._tab = tab;
@@ -42,7 +58,7 @@
this._eventTarget = tab;
this._messageDispatcher = tab.page;
- this.onBeforeNavigate = new TabEventTarget(tab, "beforeNavigate", false);
+ this.onLoading = new LoadingTabEventTarget(tab);
this.onCompleted = new TabEventTarget(tab, "navigate", false);
this.onActivated = new TabEventTarget(tab, "activate", false);
this.onRemoved = new TabEventTarget(tab, "close", false);
@@ -490,7 +506,7 @@
};
ext.tabs = {
- onBeforeNavigate: new TabEventTarget(safari.application, "beforeNavigate", true),
+ onLoading: new LoadingTabEventTarget(safari.application),
onCompleted: new TabEventTarget(safari.application, "navigate", true),
onActivated: new TabEventTarget(safari.application, "activate", true),
onRemoved: new TabEventTarget(safari.application, "close", true)
« no previous file with comments | « chrome/background.js ('k') | safari/content.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld