javascriptfirefoxwebsocketfirefox-quantum

new Websocket() return wrong object in Firefox Quantum


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.


Solution

  • 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