1

I'm using Firefox Quantum (64.0) and the JS command new WebSocket() returns a different object from the specification:

MDN Websocket

HTML Standard

The missing property that is affecting my appllication is the .close() function, but there is another differences.

You can see in the image bellow that the returned object has a .websocket porperty that contains all the missing ones. websocket object

Am I doing something wrong? With older versions of Firefox (before Quantum, like 43) or with chrome it works fine.

If it is a problem with firefox, how can I report it?

EDIT:

Adding some code example:

var exampleSocket = new WebSocket("wss://echo.websocket.org");
exampleSocket.close() // Throw "exampleSocket.close is not a function" in Firefox Quantum, works on chrome
exampleSocket.websocket.close() // Works on Firefox, Throw on chrome.

This exampleSocket.websocket is not in the documentation.

Edit2: I tested in other machines that have the firefox versions 60, 61, 63 and 64 and the problem only happened in my machine. When I removed all plugins from firefox it started to work again.

Petter
  • 318
  • 2
  • 13
  • But there *is* a `.close()` method; it's right there on the prototype object. Your question would be easier to understand if there were some code to look at. – Pointy Dec 12 '18 at 14:20
  • @Pointy I added a example. To access the `.close()` I need to use this websocket property that should not exist. – Petter Dec 12 '18 at 15:01
  • Hmm well Firefox 63.0.3 certainly doesn't do that. – Pointy Dec 12 '18 at 15:08
  • Thanks @Pointy the problem was some plugin in my Firefox. – Petter Dec 12 '18 at 15:52

1 Answers1

2

The problem was the websocketsniff plugin that I had installed.

It even state that the WebSocket object will change:

Inspect websocket frames in Firefox. How to use: 1) Open Developer Tools 2) Open "Websocket Sniffer" tab

This extension replace native websocket object for custom object. It is dirty hack, but it is single decision

Petter
  • 318
  • 2
  • 13