Skip to content
Browse files

#90 - don't even catch onbeforeunload

  • Loading branch information...
1 parent 8e045f3 commit 6343383dae9c0843fb72a6672f8ed0dd1e339bb7 @majek majek committed Oct 30, 2012
Showing with 3 additions and 4 deletions.
  1. +2 −3 lib/dom.js
  2. +1 −1 lib/trans-websocket.js
View
5 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) {
View
2 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

0 comments on commit 6343383

Please sign in to comment.
Something went wrong with that request. Please try again.