Skip to content
This repository

<esc> on Firefox crash websocket #1031

Closed
Carreau opened this Issue November 22, 2011 · 2 comments

2 participants

Matthias Bussonnier Fernando Perez
Matthias Bussonnier
Collaborator

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)

Matthias Bussonnier
Collaborator

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 ?

Matthias Bussonnier
Collaborator

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...

Matthias Bussonnier Carreau referenced this issue from a commit in Carreau/ipython November 23, 2011
Matthias Bussonnier Intercept <esc> avoid closing websocket on Firefox
	closes #1031
8900def
Fernando Perez fperez closed this issue from a commit November 23, 2011
Matthias Bussonnier Intercept <esc> avoid closing websocket on Firefox
Closes #1031; closes #1032 (rebased and fixed tiny typo)
a329ff0
Fernando Perez fperez closed this in a329ff0 November 23, 2011
Fernando Perez fperez referenced this issue from a commit January 10, 2012
Commit has since been removed from the repository and is no longer available.
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.