Skip to content

Commit

Permalink
#90 - don't even catch onbeforeunload
Browse files Browse the repository at this point in the history
  • Loading branch information
majek committed Oct 30, 2012
1 parent 8e045f3 commit 6343383
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions lib/dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion lib/trans-websocket.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6343383

Please sign in to comment.