Closed Bug 676881 Opened 13 years ago Closed 12 years ago

escape key closes open websocket in Firefox

Categories

(Firefox :: General, defect)

5 Branch
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 614304

People

(Reporter: surfing+bugzilla, Unassigned)

Details

Attachments

(2 files)

Attached file 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.
Attachment #551078 - Attachment mime type: text/plain → text/html
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.
Bug 614304 comment 3 (and below) explains it.
It's afaik not possible to prevent this.
Status: UNCONFIRMED → NEW
Depends on: 614304
Ever confirmed: true
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.
(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
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
OS: Windows Vista → All
Hardware: x86_64 → All
This issue is still present in Firefox 8, where websockets are enabled by default. Is it possible to get this fixed?
Looks like this is related possible to the things mentioned in this bug: https://bugzilla.mozilla.org/show_bug.cgi?id=614304
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: