Are there differences in the way WebSocket API is implemented in different browsers?

I am new to websockets and have been asked to investigate a problem we’re having with our app. Our app uses xmpp.js, and its behavior when there is no internet connection is different depending on the browser.

For example, when the the internet connection is cut, our app goes into offline mode. However, we’ve noticed that on some pages, Chrome and Safari will never go into offline mode, while Firefox always does in 10 seconds. Additionally, on pages where Chrome and Safari do go into offline mode when there is no internet, the time that they detect disconnection differs. On Safari it seems to be 2 minutes, while on Chrome it takes around 1.5 to 2.5 minutes.

I went through the source code of xmpp.js, and it appears that the package is basically waiting for websocket to tell it that the connection has been closed. So that leads me to think that different browsers have different implementations on when to close the websocket connection. Is this assumption of mine correct?

I asked this question on Stack Exchange and got this great answer. I’ll post a link here for anyone else who has a similar question:

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.