New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESC in Firefox breaks sockjs connection #18

Closed
majek opened this Issue Oct 24, 2011 · 10 comments

Comments

Projects
None yet
6 participants
@majek
Member

majek commented Oct 24, 2011

@majek

This comment has been minimized.

Show comment
Hide comment
@majek

majek Nov 18, 2011

Member

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

Member

majek commented Nov 18, 2011

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

@majek majek closed this Nov 18, 2011

@vicngtor

This comment has been minimized.

Show comment
Hide comment
@vicngtor

vicngtor Mar 21, 2012

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

Currently it completely messes up my UX flow.

vicngtor commented Mar 21, 2012

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

Currently it completely messes up my UX flow.

@majek

This comment has been minimized.

Show comment
Hide comment
@majek

majek Mar 21, 2012

Member

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;});
Member

majek commented Mar 21, 2012

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;});
@jwheare

This comment has been minimized.

Show comment
Hide comment
@jwheare

jwheare commented Apr 27, 2012

See also this bugzilla discussion. https://bugzilla.mozilla.org/show_bug.cgi?id=614304

@majek

This comment has been minimized.

Show comment
Hide comment
@majek

majek Apr 27, 2012

Member

@jwheare Great, thanks for the link!

Member

majek commented Apr 27, 2012

@jwheare Great, thanks for the link!

@alp82

This comment has been minimized.

Show comment
Hide comment
@alp82

alp82 Jun 9, 2012

@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()) })

alp82 commented Jun 9, 2012

@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

This comment has been minimized.

Show comment
Hide comment
@majek

majek Jun 9, 2012

Member

@alp82 Brilliant, thanks!

Member

majek commented Jun 9, 2012

@alp82 Brilliant, thanks!

@njam njam referenced this issue Feb 11, 2013

Merged

Add client library #10

tomaszdurka added a commit to tomaszdurka/socket-redis that referenced this issue Feb 11, 2013

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
@graue

This comment has been minimized.

Show comment
Hide comment
@graue

graue Aug 19, 2013

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

graue commented Aug 19, 2013

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

@Yaffle

This comment has been minimized.

Show comment
Hide comment
@Yaffle

Yaffle Aug 19, 2013

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

Yaffle commented Aug 19, 2013

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

@graue

This comment has been minimized.

Show comment
Hide comment
@graue

graue Aug 19, 2013

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.

graue commented Aug 19, 2013

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