Closed emreokutan closed 4 years ago
well i am not sure about what happened but i have reinstalled the exact same version of firefox and the behaviour has changed! Now the returned websocket instance from constructer is just o single websocket instance and works fine without any changes.
With Firefox 77.0.1 (64 bit) when i check websocket support with DetectRTC.checkWebSocketsSupport when disconnecting from websocket on websocket.onmessage in DetectRTC.js file with using websocket.close firefox throws an error saying that:
TypeError: websocket.close is not a function
So the socket connection stays active.
When i tested the behaviour on the same error happens and the reason is firefox WebSocket constructer returns a different referance to the socket object. It is like : Object { websocket: WebSocket, listeners: {…} } but other browsers returns: just a single WebSocket instance.
so on firefox there is no websocket.close but there is websocket.websocket.close. so i changed the code in onmessage function like this:
now it is ok to disconnect.