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

Update Chrome beforeunload dialog control behavior #20942

Conversation

chrisdavidmills
Copy link
Contributor

@chrisdavidmills chrisdavidmills commented Oct 10, 2023

Summary

Chrome 119 includes an update to the beforeunload event — it now triggers the "leave page?" confirmation dialog when e.preventDefault() is called upon the event firing, and doesn't do that when e.returnValue is set to an empty string. This PR updates the compat data appropriately.

See https://chromestatus.com/feature/4968823574233088 for the implementation details; the engineer has informed me that the actual release version will be 119).

This is great because Chrome now behaves like other browsers, so this event is immediately more useful than it was.

I intend to update the corresponding docs too.

Test results and supporting details

Related issues

@github-actions github-actions bot added infra Infrastructure issues (npm, GitHub Actions, releases) of this project data:api Compat data for Web APIs. https://developer.mozilla.org/docs/Web/API dependencies Pull requests that update a dependency package or file. labels Oct 10, 2023
@chrisdavidmills chrisdavidmills marked this pull request as draft October 10, 2023 17:35
@github-actions github-actions bot added the merge conflicts 🚧 This PR needs to merge latest "main" branch to resolve a merge conflict or other issue. label Oct 10, 2023
@github-actions
Copy link

This pull request has merge conflicts that must be resolved before it can be merged.

@github-actions github-actions bot added merge conflicts 🚧 This PR needs to merge latest "main" branch to resolve a merge conflict or other issue. and removed merge conflicts 🚧 This PR needs to merge latest "main" branch to resolve a merge conflict or other issue. infra Infrastructure issues (npm, GitHub Actions, releases) of this project dependencies Pull requests that update a dependency package or file. labels Oct 10, 2023
@chrisdavidmills chrisdavidmills marked this pull request as ready for review October 11, 2023 07:26
api/BeforeUnloadEvent.json Outdated Show resolved Hide resolved
api/BeforeUnloadEvent.json Outdated Show resolved Hide resolved
@chrisdavidmills chrisdavidmills merged commit b3354d0 into mdn:main Oct 13, 2023
4 checks passed
@chrisdavidmills chrisdavidmills deleted the beforeunload-dialog-control-chrome-update branch October 13, 2023 07:05
queengooborg added a commit that referenced this pull request Oct 13, 2023
@queengooborg
Copy link
Contributor

This was not ready to be merged and the descriptions don't have the proper HTML escapes, so it will cause rendering issues.

@chrisdavidmills
Copy link
Contributor Author

@queengooborg dammnit, sorry about that. I was getting anxious because the corresponding content update got merged without the BCD being in place.

Do you need me to submit this again?

Elchi3 pushed a commit to Elchi3/browser-compat-data that referenced this pull request Nov 14, 2023
* Update Chrome beforeunload dialog control behavior

* Clarify empty string returnValue behavior change in Chromium

* update deprecated status for consistency, add remove data

* Make information about returnValue consistent

* activation works with any truthy value

* Update api/BeforeUnloadEvent.json

Co-authored-by: Queen Vinyl Da.i'gyu-Kazotetsu <[email protected]>

* Update api/BeforeUnloadEvent.json

Co-authored-by: Queen Vinyl Da.i'gyu-Kazotetsu <[email protected]>

---------

Co-authored-by: Queen Vinyl Da.i'gyu-Kazotetsu <[email protected]>
Elchi3 pushed a commit to Elchi3/browser-compat-data that referenced this pull request Nov 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data:api Compat data for Web APIs. https://developer.mozilla.org/docs/Web/API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants