Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unload event #192

Merged
merged 3 commits into from
Mar 27, 2024
Merged

Remove unload event #192

merged 3 commits into from
Mar 27, 2024

Conversation

AlecM33
Copy link
Owner

@AlecM33 AlecM33 commented Mar 27, 2024

The unload event is deprecated and can interfere with the back forward cache. See https://web.dev/articles/bfcache?utm_source=lighthouse&utm_medium=devtools#never_use_the_unload_event

Thus we use the page hide event instead to manually close the socket. Then, when the user uses forward nav for example, we need to manually reconnect according to the socket.io docs.

Example of being able to use back and forward nav and re-establishing a socket connection

2fadf9438121a607028551671c8f2ac2.mp4

@AlecM33 AlecM33 merged commit 01ed3c6 into master Mar 27, 2024
3 checks passed
@AlecM33 AlecM33 deleted the remove-unload-event branch April 30, 2024 23:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant