As a security precaution, we have turned on the setting "Require API key authentication for API requests" for everyone. If this has broken something, please contact bugzilla-admin@mozilla.org
Last Comment Bug 676881 - escape key closes open websocket in Firefox
: escape key closes open websocket in Firefox
Status: RESOLVED DUPLICATE of bug 614304
:
Product: Firefox
Classification: Client Software
Component: General (show other bugs)
: 5 Branch
: All All
: -- normal with 4 votes (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-08-05 10:30 PDT by teeteehaa
Modified: 2017-01-13 07:37 PST (History)
8 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
index.html (1.28 KB, text/html)
2011-08-05 10:30 PDT, teeteehaa
no flags Details
partial fix for the symptom of the initial test case (2.09 KB, text/plain)
2011-08-06 06:53 PDT, teeteehaa
no flags Details

Description User image teeteehaa 2011-08-05 10:30:56 PDT
Created attachment 551078 [details]
index.html

User Agent: Mozilla/5.0 (Windows NT 6.0; WOW64; rv:5.0) Gecko/20100101 Firefox/5.0
Build ID: 20110615151330

Steps to reproduce:

Pressed escape key in Firefox while a websocket connection was open.


Actual results:

The websocket connection was closed. This happened in Firefox 5 on Windows Vista 64 Bit and Windows 7 64 Bit. This did not happen in Chrome or Opera. A test case is attached (index.html). In case this is not a bug I'd love to know how to prevent it anyway (in JavaScript). There already is a similar (but not the same) bug: "614304 - ESC key aborts XMLHttpRequest"


Expected results:

The websocket connection should have stayed open.
Comment 1 User image Thomas Ahlblom 2011-08-05 10:58:03 PDT
Mozilla/5.0 (X11; Linux x86_64; rv:5.0.1) Gecko/20100101 Firefox/5.0.1

I get this error message in Firefox:
[19:51:02.337] WebSocket is not defined @ https://bug676881.bugzilla.mozilla.org/attachment.cgi?id=551078:9

Something I'm missing? Chromium is a WFM.
Comment 2 User image Jo Hermans 2011-08-05 12:19:38 PDT
Bug 614304 comment 3 (and below) explains it.
Comment 3 User image Matthias Versen [:Matti] 2011-08-05 15:23:32 PDT
It's afaik not possible to prevent this.
Comment 4 User image teeteehaa 2011-08-06 06:53:38 PDT
Created attachment 551253 [details]
partial fix for the symptom of the initial test case
Comment 5 User image teeteehaa 2011-08-06 06:59:38 PDT
I found a partial fix for the symptom (attachment 551253 [details], file "partialsymptomfix.html"). It uses jQuery and it prevents the websocket from being closed at least in case the document has the focus.
Comment 6 User image teeteehaa 2011-08-06 07:03:19 PDT
(In reply to Thomas Ahlblom from comment #1)
> Mozilla/5.0 (X11; Linux x86_64; rv:5.0.1) Gecko/20100101 Firefox/5.0.1
> 
> I get this error message in Firefox:
> [19:51:02.337] WebSocket is not defined @
> https://bug676881.bugzilla.mozilla.org/attachment.cgi?id=551078:9
> 
> Something I'm missing? Chromium is a WFM.

In Firefox 4 and 5 the websockets implementation is disabled by default due to security reasons and you have to override this to enable websockets. Please read the red box on the bottom of the following website:
https://developer.mozilla.org/en/WebSockets
Comment 7 User image Thomas Ahlblom 2011-08-06 07:45:16 PDT
Reproduced:
Mozilla/5.0 (X11; Linux x86_64; rv:5.0.1) Gecko/20100101 Firefox/5.0.1
Mozilla/5.0 (X11; Linux i686 on x86_64; rv:5.0.1) Gecko/20100101 Firefox/5.0.1

WFM:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.112 Safari/534.30
Comment 8 User image Micheil Smith 2011-11-17 05:22:07 PST
This issue is still present in Firefox 8, where websockets are enabled by default. Is it possible to get this fixed?
Comment 9 User image Micheil Smith 2011-11-17 05:25:39 PST
Looks like this is related possible to the things mentioned in this bug: https://bugzilla.mozilla.org/show_bug.cgi?id=614304
Comment 10 User image :Ms2ger (⌚ UTC+1/+2) 2012-04-13 11:55:43 PDT

*** This bug has been marked as a duplicate of bug 614304 ***

Note You need to log in before you can comment on or make changes to this bug.