# Client WebSocket disconnects when browser is minimized or not in focus - Chrome

**URL:** <https://community.solace.com/t/client-websocket-disconnects-when-browser-is-minimized-or-not-in-focus-chrome/690>\
**Category:** Training, Tips and Tricks\
**Created:** [April 7, 2021, 7:44pm UTC](https://community.solace.com/t/client-websocket-disconnects-when-browser-is-minimized-or-not-in-focus-chrome/690 "2021-04-07T19:44:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/solace/original/1X/1248f38eea018157e66cc024e8284f3331a54f94.png) [@system](https://community.solace.com/u/system)\
**Post date:** [April 7, 2021, 7:44pm UTC](https://community.solace.com/t/client-websocket-disconnects-when-browser-is-minimized-or-not-in-focus-chrome/690/1 "2021-04-07T19:44:34Z")

</div>

Here’s a tip for anyone using websockets and chrome to establish a connection to their PubSub+ broker.

###The issue:  
You might be experiencing websocket disconnects after 5-6 minutes of your chrome browser being minimized or out in focus. The session disconnects with the message “Connection closed: 1001 Going Away (The endpoint is going away due to a server failure or client navigation), clean closure: true”

###The cause:  
In July 2020, a Chrome feature intended to save battery life was introduced. “Intensive throttling of Javascript timer wake ups” throttles at a 1-minute (60 second) interval. See here for more info: [Chrome Platform Status](https://www.chromestatus.com/feature/4718288976216064)

This conflicts with the default web-transport inactive-timeout setting that is set to 30s on client profiles.

When the Javascript timer is throttled at a 1-minute interval, the web client will be unable to send keepalive messages to your broker within the default 30s inactivity timeout. To avoid the issue, either disable the feature “Intensive throttling of Javascript timer wake ups” in Chrome or change the inactivity-timeout to a value more than 60s.

###The fix:  
To avoid the issue, either

1. disable the feature “Intensive throttling of Javascript timer wake ups” in Chrome or,
2. change the [web-transport inactive-timeout in the client profile](https://docs.solace.com/Solace-CLI/CLI-Reference/VMR_CLI_Commands.html#Root_enable_configure_client-profile_service_web-transport_inactive-timeout) to more than 60 seconds.

To disable the Chrome feature, key in “chrome://flags” in Chrome URL field, search for “Throttle Javascript timer” and disable the feature.

---

<div class="post-metadata">

**Author:** ![marc](https://yyz1.discourse-cdn.com/solace/user_avatar/community.solace.com/marc/32/2191_2.png) [@marc](https://community.solace.com/u/marc)\
**Post date:** [April 7, 2021, 7:52pm UTC](https://community.solace.com/t/client-websocket-disconnects-when-browser-is-minimized-or-not-in-focus-chrome/690/2 "2021-04-07T19:52:15Z")

</div>

Thanks for sharing @trishm!

For changing the “Web Transport Inactive Timeout” on the client-profile you can modify it via CLI as Trish pointed out, but you can also modify it via SEMPv2 or in the PubSub+ Manager 🙂

 ![image.png](https://canada1.discourse-cdn.com/solace/original/2X/9/93bc11b9e6f5ecf763dd3e291986919345d60d97.png)

![image.png](https://canada1.discourse-cdn.com/solace/original/2X/3/3d087f9586e7e96a63ef9a34672277a7fa4d63c7.png)

---

<div class="post-metadata">

**Author:** ![Aaron](https://yyz1.discourse-cdn.com/solace/user_avatar/community.solace.com/aaron/32/843_2.png) [@Aaron](https://community.solace.com/u/Aaron)\
**Post date:** [April 13, 2021, 3:39am UTC](https://community.solace.com/t/client-websocket-disconnects-when-browser-is-minimized-or-not-in-focus-chrome/690/3 "2021-04-13T03:39:46Z")

</div>

I actually didn’t know this! It explains why my JavaScript bus demo disconnects a lot more frequently now, vs. a couple years ago if I’m away from that Chrome tab. I’ve updated the`web-transport` `inactive-timeout` in my client-profile to 75 seconds and it totally fixed the issue! ?
