escape key closes open websocket in Firefox

RESOLVED DUPLICATE of bug 614304

Status

()

Firefox
General
RESOLVED DUPLICATE of bug 614304
6 years ago
4 months ago

People

(Reporter: teeteehaa, Unassigned)

Tracking

5 Branch
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Reporter)

Description

6 years ago
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.

Updated

6 years ago
Attachment #551078 - Attachment mime type: text/plain → text/html

Comment 1

6 years ago
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

6 years ago
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
(Reporter)

Comment 4

6 years ago
Created attachment 551253 [details]
partial fix for the symptom of the initial test case
(Reporter)

Comment 5

6 years ago
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.
(Reporter)

Comment 6

6 years ago
(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

6 years ago
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

Comment 8

6 years ago
This issue is still present in Firefox 8, where websockets are enabled by default. Is it possible to get this fixed?

Comment 9

6 years ago
Looks like this is related possible to the things mentioned in this bug: https://bugzilla.mozilla.org/show_bug.cgi?id=614304

Updated

5 years ago
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 614304
No longer depends on: 614304
You need to log in before you can comment on or make changes to this bug.