Skip to content

Commit 7c85c6b

Browse files
committed
#90 - don't even catch onbeforeunload
1 parent 433cca6 commit 7c85c6b

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

lib/dom.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,8 @@ var unload_triggered = function() {
7373
trigger_unload_callbacks();
7474
};
7575

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.
7978
utils.attachEvent('unload', unload_triggered);
8079

8180
utils.unload_add = function(listener) {

lib/trans-websocket.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ var WebSocketTransport = SockJS.websocket = function(ri, trans_url) {
2323
that.ri._didMessage(e.data);
2424
};
2525
// 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
2727
// navigates away from the page. In such situation let's lie -
2828
// let's not open the ws connection at all. See:
2929
// https://github.com/sockjs/sockjs-client/issues/28

0 commit comments

Comments
 (0)