beforeUnload Not Working with Socket.io #5053
Unanswered
Shivam-Shandilya1
asked this question in
Q&A
Replies: 1 comment
-
Hi! The Reference: https://socket.io/docs/v4/client-options/#closeonbeforeunload |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Before closing the tab or window I ask the user either they want to leave? If they confirms The socket should disconnect otherwise there will be no change.
I am using
"socket.io": "^4.7.5",
"socket.io-client": "^4.7.5",
"socket.io-redis": "^6.1.1",
and Browser: Chrome
But actual result: after closing tab, the socket immediately got disconnected even without listening to the user confirmation.
Beta Was this translation helpful? Give feedback.
All reactions