How do I prevent Chrome from suspending a non-foreground tab/window?

Viewed 425

I have a site which uses websockets to communicate with a server to stream realtime financial quotes. When the page is not in the foreground, after approximately 3 minutes Chrome kills the socket connection. The socket disconnection can be seen in the server log. As long as I bring the page to the foreground within a few minutes of backgrounding it, the socket is kept alive.

I'm aware that Chrome (and presumably other Chromium-based browsers) limit background pages to save power, CPU and memory. However, I am unable to find a way to permanently disable this feature for a given URL.

  • chrome://discards/ allows me to temporarily disable the feature for a given tab, but only until it is closed
  • pinging the websocket connection periodically does not keep the socket open when in the background
  • running Chrome in App mode (with the "--app=" command line switch) does not keep the socket open
  • kiosk mode command line switch no longer seems to work at all (at least on Chrome 89.0.4389.90)
  • disabling occlusion checking under chrome://flags/ also does not keep the socket alive

Have I missed anything, or is there really no way to force Chrome to keep a certain URL alive under all circumstances?

Thanks

0 Answers
Related