Skip to content
This repository
Browse code

#90 - don't even catch onbeforeunload

  • Loading branch information...
commit 6343383dae9c0843fb72a6672f8ed0dd1e339bb7 1 parent 8e045f3
Marek majek authored

Showing 2 changed files with 3 additions and 4 deletions. Show diff stats Hide diff stats

  1. +2 3 lib/dom.js
  2. +1 1  lib/trans-websocket.js
5 lib/dom.js
@@ -73,9 +73,8 @@ var unload_triggered = function() {
73 73 trigger_unload_callbacks();
74 74 };
75 75
76   -// Onbeforeunload alone is not reliable. We could use only 'unload'
77   -// but it's not working in opera within an iframe. Let's use both.
78   -utils.attachEvent('beforeunload', unload_triggered);
  76 +// 'unload' alone is not reliable in opera within an iframe, but we
  77 +// can't use `beforeunload` as IE fires it on javascript: links.
79 78 utils.attachEvent('unload', unload_triggered);
80 79
81 80 utils.unload_add = function(listener) {
2  lib/trans-websocket.js
@@ -23,7 +23,7 @@ var WebSocketTransport = SockJS.websocket = function(ri, trans_url) {
23 23 that.ri._didMessage(e.data);
24 24 };
25 25 // Firefox has an interesting bug. If a websocket connection is
26   - // created after onbeforeunload, it stays alive even when user
  26 + // created after onunload, it stays alive even when user
27 27 // navigates away from the page. In such situation let's lie -
28 28 // let's not open the ws connection at all. See:
29 29 // 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.