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:08 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') | safari/content.js » ('J')
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,21 @@
}
};
+ 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)
Felix Dahlke 2013/11/15 13:28:38 Shouldn't we check if event.target is an instance
Sebastian Noack 2013/11/15 13:45:29 Shouldn't be required here. Only tabs can send mes
+ listener(new Tab(event.target));
+ };
+ }
+ };
+
Tab = function(tab)
{
this._tab = tab;
@@ -42,7 +57,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 +505,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') | safari/content.js » ('J')

Powered by Google App Engine
This is Rietveld