← Back to release summary

Change beforeunload handler dialog condition

Category
DOM
Type
No developer-visible change
Status
Enabled by default (Chrome 117)
Intent stage
Dev trials

Summary

To comply with HTML standard, there are two new changes on how the cancel dialog gets prompted for beforeunload event. 1. If event.preventDefault() is called, prompt cancel dialog. 2. If event.returnValue is the empty string, do not prompt cancel dialog.

Standards & signals

View on chromestatus.com