returnValue property
The returnValue property of the
BeforeUnloadEvent interface, when set to a truthy value, triggers a
browser-generated confirmation dialog asking users to confirm if they
really want to leave the page when they try to close or reload it, or
navigate somewhere else. This is intended to help prevent loss of unsaved
data.
Note:
returnValueis a legacy feature, and best practice is to trigger the dialog by invoking Event.preventDefault on theBeforeUnloadEventobject, while also settingreturnValueto support legacy cases. See theWindow.beforeunload_eventevent reference for detailed up-to-date guidance.
Implementation
external String get returnValue;
Implementation
external set returnValue(String value);