Photon the client keeps disconnecting in webgl

hello have a multiplayer project that use photon pun 2 in webgl but the client keeps disconnecting when the browser tab is in backgroud , unity 2022.3.8f1 , someone have some advice ? thanks in advance

This is normal behavior in some browsers. The update rate may be lower or entirely stopped.
I didn’t run into the issue in a recent Firefox with Unity’s build and run option (so a local server).
Try playback of some audio. Even if it’s inaudible, some developers reported this works to get more updates.

the best way to handle this would be to reconnect when you reopen the browser tab? or are there other ways?

Yes, that’s probably the best. When you create a room, you can set a PlayerTTL. During time, beginning with a disconnect, the player in question is marked as inactive for the others but still in the room. Players can ReconnectAndRejoin during this time. In best case, you clear the scene / networked objects before you reconnect, because they are being sent on join as if the returning player is a new one.

Thanks for the answers , im gonna look in to that