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

Problem closeOnBeforeunload #4065

Closed
Madriix opened this issue Aug 28, 2021 · 1 comment
Closed

Problem closeOnBeforeunload #4065

Madriix opened this issue Aug 28, 2021 · 1 comment
Labels
documentation Improvements or additions to documentation
Milestone

Comments

@Madriix
Copy link

Madriix commented Aug 28, 2021

Describe the bug
Customer parameter closeOnBeforeunload by default it is true, should be false

To Reproduce

Please fill the following code example:

Socket.IO server and client version: 4.1.3

Read my post here #4040 (comment)

We would have to do a tutorial, for example a space "Optimize socket.io 4.x to behave like socket.io 2.x" and put the parameters like closeOnBeforeunload to false instead of true, and other things.

Platform:

  • Device: Firefox 91.0.2
  • OS: Windows 7 (x64)
@Madriix Madriix added the bug Something isn't working label Aug 28, 2021
@darrachequesne darrachequesne added documentation Improvements or additions to documentation and removed bug Something isn't working labels Jun 20, 2023
darrachequesne added a commit to socketio/engine.io-client that referenced this issue Jun 28, 2023
Silently closing the connection when receiving a "beforeunload" event
is problematic, because it is emitted:

- when downloading a file from another host

Related: socketio/socket.io#4436

- when the user already has a listener for the "beforeunload" event
(i.e. "are you sure you want to leave this page?")

Related:

- #661
- #658
- socketio/socket.io#4065

That's why the `closeOnBeforeunload` option will now default to false.
darrachequesne added a commit to socketio/socket.io-website that referenced this issue Aug 4, 2023
@darrachequesne
Copy link
Member

For future readers:

The closeOnBeforeunload option now defaults to false, which makes more sense.

Reference: https://socket.io/docs/v4/client-options/#closeonbeforeunload

@darrachequesne darrachequesne added this to the 4.7.1 milestone Aug 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants