[Pkg-javascript-commits] [sockjs-client] 418/434: #90 - don't even catch onbeforeunload

Tonnerre Lombard tonnerre-guest at moszumanska.debian.org
Wed Jan 8 00:47:30 UTC 2014


This is an automated email from the git hooks/post-receive script.

tonnerre-guest pushed a commit to branch master
in repository sockjs-client.

commit 7c85c6b8f56d27c775a7a840e7b26bec338fde37
Author: Marek Majkowski <majek04 at gmail.com>
Date:   Tue Oct 30 11:58:18 2012 +0000

    #90 - don't even catch onbeforeunload
---
 lib/dom.js             | 5 ++---
 lib/trans-websocket.js | 2 +-
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/lib/dom.js b/lib/dom.js
index e1ce970..78a3b49 100644
--- a/lib/dom.js
+++ b/lib/dom.js
@@ -73,9 +73,8 @@ var unload_triggered = function() {
     trigger_unload_callbacks();
 };
 
-// Onbeforeunload alone is not reliable. We could use only 'unload'
-// but it's not working in opera within an iframe. Let's use both.
-utils.attachEvent('beforeunload', unload_triggered);
+// 'unload' alone is not reliable in opera within an iframe, but we
+// can't use `beforeunload` as IE fires it on javascript: links.
 utils.attachEvent('unload', unload_triggered);
 
 utils.unload_add = function(listener) {
diff --git a/lib/trans-websocket.js b/lib/trans-websocket.js
index 5bd2e67..7f6362a 100644
--- a/lib/trans-websocket.js
+++ b/lib/trans-websocket.js
@@ -23,7 +23,7 @@ var WebSocketTransport = SockJS.websocket = function(ri, trans_url) {
         that.ri._didMessage(e.data);
     };
     // Firefox has an interesting bug. If a websocket connection is
-    // created after onbeforeunload, it stays alive even when user
+    // created after onunload, it stays alive even when user
     // navigates away from the page. In such situation let's lie -
     // let's not open the ws connection at all. See:
     // https://github.com/sockjs/sockjs-client/issues/28

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/sockjs-client.git



More information about the Pkg-javascript-commits mailing list