Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

ESC in Firefox breaks sockjs connection #18

Closed
majek opened this Issue · 10 comments

6 participants

@majek
Owner

There isn't going to be a fix for that. Users have to cope.

@majek majek closed this
@vicngtor

"There isn't going to be a fix for that." Can you elaborate on that?

Currently it completely messes up my UX flow.

@majek
Owner

Sure. This is a well known problem (that's why it's documented). Fixing this is out of the scope for SockJS - that would require messing with user key events, which isn't SockJS responsibility by any means.

I haven't run this in anger, but just catching the esc key in jquery seems to be working fine, please tell me if that works for you:

$('html').keypress(function(e){return e.which !== 0;});
@majek
Owner

@jwheare Great, thanks for the link!

@alp82

@majek Your workaround causes that F5 is not working anymore in Firefox (tested with FF 11.0 in Ubuntu Linux 64 Bit).

Better use this (taken from the bugzilla link) as a workaround:

window.addEventListener('keydown', function(e) { (e.keyCode == 27 && e.preventDefault()) })
@majek
Owner

@alp82 Brilliant, thanks!

@tomaszdurka tomaszdurka referenced this issue from a commit in tomaszdurka/socket-redis
@tomaszdurka tomaszdurka Apply formatting
retryDelayed: Use milliseconds
subscribe(): Pass callback
unsubscribe(): No start and data
message(): No channel
message(): Rename to send() (like in WS)
onConnect -> onopen
onDisconnect -> onclose
Drop onMessage
ESC fix: sockjs/sockjs-client#18
Constructor: Remove protocols, don't set whitelist manually
55706bf
@graue

Protip for anyone finding this on Google: This is no longer an issue. Mozilla fixed it on the Firefox side.

@Yaffle

@graue , really?
Did you try while page loading?

@graue

While the page is still loading, I assume that it will break WebSocket connections :) It'll also break downloading images, CSS and JavaScript. That's what clicking "Stop" or pressing Escape is supposed to do :) But anytime the Stop button is hidden/disabled in Firefox, Escape does nothing at the browser level. So the problem people were talking about in 2011 is gone.

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.