4 ms·
Maybe it was to log a player off from a game, rather than have a dangling player. (Though websocket would work better)
by soylentgraham 5y ago
Maybe it was to log a player off from a game, rather than have a dangling player. (Though websocket would work better)
- deleted 5y ago[deleted]
- inglor 5y agoThis is true and in general websockets (well, and webtransport/webrtc etc) are the only reliable way to detect navigation from the backend since none of the methods mentioned in the article work if the user simply closed the tab.
- ncann 5y agoonunload/onbeforeunload doesn't work?
- jen20 5y agoWhat if they kill -9 the browser process?
- inglor 4y agoNot always, not necessarily if the tab was in the background when closed (switch then close), not if they force quit (like the other comment I upvoted says), not if chrome updates etc. The other alternatives are opening another type of connection like an RTCPeerConnection to your server and seeing when that closes.
- deleted 5y ago[deleted]