Skip to content

<esc> on Firefox crash websocket #1031

Closed
Carreau opened this Issue Nov 23, 2011 · 2 comments

2 participants

@Carreau
IPython member
Carreau commented Nov 23, 2011

Firefox 8.1 , at least on mac, master (aa2337b), earlier too.
Does not crash on Chrome or Safari

open a notebook and press <esc>. Kernel become irresponsive
firebug give :

La connexion avec ws://127.0.0.1:8888/kernels/0e7cda16-fd63-4d9d-9b31-3c8a67c2bbb8/iopub a été interrompue pendant le chargement de la page.
this.iopub_channel = new this.WebSocket(ws_url + "/iopub");
kernel.js (ligne 125)
La connexion avec ws://127.0.0.1:8888/kernels/0e7cda16-fd63-4d9d-9b31-3c8a67c2bbb8/shell a été interrompue pendant le chargement de la page.
this.shell_channel = new this.WebSocket(ws_url + "/shell"); 

(discoverd by @fperez, see PR #987 but I, at least, can reproduce it on master)

@Carreau
IPython member
Carreau commented Nov 23, 2011

I answer to myself.
I think that by default, <esc> cancel the page loading on FF, which close the websocket connexion.
assuming <esc> keycode is 27 on all system, we should put

if( event.keyCode == 27 ){
   event.preventDefault()
}

in the right place, CodeCell.prototype.handle_codemirror_keyevent ?

note that it does work, but might it prevent other actions ?

@Carreau
IPython member
Carreau commented Nov 23, 2011

And I correct myself again,
No, in CodeCell.prototype.handle_codemirror_keyevent is not enough , it prevent loosing websocket connexion, only when codemirror is on focus...

@Carreau Carreau added a commit to Carreau/ipython that referenced this issue Nov 23, 2011
@Carreau Carreau Intercept <esc> avoid closing websocket on Firefox
	closes #1031
8900def
@fperez fperez added a commit that closed this issue Nov 24, 2011
@Carreau Carreau Intercept <esc> avoid closing websocket on Firefox
Closes #1031; closes #1032 (rebased and fixed tiny typo)
a329ff0
@fperez fperez closed this in a329ff0 Nov 24, 2011
@mattvonrocketstein mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this issue Nov 3, 2014
@Carreau Carreau Intercept <esc> avoid closing websocket on Firefox
Closes #1031; closes #1032 (rebased and fixed tiny typo)
ec8b56c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.