---
id: "beforeunload"
kind: "web-feature"
canonical: "https://timetostable.com/feature/beforeunload"
baseline: "limited"
bcd_version: "8.1.11"
web_features_version: "3.48.0"
---

# 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.

- **Group**: other
- **Baseline**: Limited Availability
- **Specification**: https://html.spec.whatwg.org/multipage/nav-history-apis.html#the-beforeunloadevent-interface
- **Constituent BCD keys**: 4

## Browser Support Timeline

| Browser | Version | Release Date |
| --- | --- | --- |
| Firefox | 1 | 2004-11-09 |
| Safari | 3 | 2007-10-26 |
| Chrome | 1 | 2008-12-11 |
| Firefox for Android | 4 | 2011-03-29 |
| Chrome Android | 18 | 2012-06-27 |
| Edge | 12 | 2015-07-29 |

