Skip to main content

BeforeunloadEventCancelByPreventDefaultEnabled

Control new behavior for the cancel dialog produced by the beforeunload event - BeforeunloadEventCancelByPreventDefaultEnabled​

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.

  • true: Show cancel dialog when event.preventDefault() is called for beforeunload event. Do not show cancel dialog when event.returnValue is the empty string for beforeunload event.
  • false: Do not show cancel dialog when event.preventDefault() is called for beforeunload event. Show cancel dialog when event.returnValue is the empty string for beforeunload event.
  • not set: Use default behavior of feature rollout plan.

Data Type:

Boolean

Supported features:

  • Dynamic Policy Refresh: True
  • Per Profile: True