<- Chrome Settings Library

BeforeunloadEventCancelByPreventDefaultEnabled

Control new behavior for the cancel dialog produced by the beforeunload event
Last updated October 31, 2024
Deprecated

From M131, this policy is deprecated.This policy provides a temporary opt-out for two related fixes to the behavior of the confirmation dialog shown by the beforeunload event. When this policy is Enabled, the new and correct behavior will be used. When this policy is Disabled, the old and legacy behavior will be used. When this policy is not set, the default behavior will be used. This policy is a temporary workaround and will be removed soon. New and correct behavior: In `beforeunload`, calling `event.preventDefault()` will trigger the confirmation dialog. Setting `event.returnValue` to the empty string will not trigger the confirmation dialog. Old and legacy behavior: In `beforeunload`, calling `event.preventDefault()` will not trigger the confirmation dialog. Setting `event.returnValue` to the empty string will trigger the confirmation dialog.

Supported On:
Platform Start End
Android 117 130
Chrome (Windows, Mac, Linux) 117 130
ChromeOS 117 130
webview_android 117 130
Example value:

true

Features: