Limited Availability
id: beforeunload
beforeunload
The
beforeunload event is fired when the current window is about to be unloaded. Typically this is used to display a dialog to confirm if users really want to leave the page when there is unsaved data that would be lost.
Baseline Status:
This feature is currently Limited and is missing in at least one major browser engine.
Desktop Browser Engine Support
Google Chrome
1
Supported
Mozilla Firefox
1
Supported
Apple Safari
3
Supported
Microsoft Edge
12
Supported
Mobile Browser Engine Support
Chrome Android
18
Firefox Android
4
Safari iOS
—
Specifications and References