Baseline Widely DOM API
api.Document.visibilitychange_event
Granular MDN Browser Compat Data support history across 14 tracked browsers.
Specification Area
DOM API
Standard track
First Core Launch
Firefox 56
2017-09-28
Core-3 Stability
1,306d (3.6y)
Last: Safari (2021-04-26)
Baseline Feature
Widely
Page visibility
Browser Support Timeline
Notes (5)
Chrome, Safari, Edge, Chr And, Saf iOS, WV And, WV iOS, Samsung, Opera, Op And, Quest, IE: Theonvisibilitychange event handler property is not supported.Safari, Saf iOS, WV iOS: Doesn't fire the visibilitychange event when navigating away from a document, so also include code to check for the pagehide event (which does fire for that case in all current browsers). See bug 116769, bug 151234, bug 151610, and bug 194897.Safari: Before Safari 14, the event does not bubble, so document.addEventListener('visibilitychange', ...) works, but window.addEventListener('visibilitychange', ...) does not.Saf iOS: Before Safari on iOS 14, the event does not bubble, so document.addEventListener('visibilitychange', ...) works, but window.addEventListener('visibilitychange', ...) does not.WV iOS: Before WebView on iOS 14, the event does not bubble, so document.addEventListener('visibilitychange', ...) works, but window.addEventListener('visibilitychange', ...) does not.Full Browser Compatibility Table
| Browser | Type | Version | Release Date | Status / Caveats |
|---|---|---|---|---|
| Chrome | desktop | 62 | 2017-10-17 | Supported |
| Firefox | desktop | 56 | 2017-09-28 | Supported |
| Safari | desktop | 14.1 | 2021-04-26 | Supported |
| Edge | desktop | 18 | 2018-10-02 | Supported |
| Chrome Android | mobile | 62 | 2017-10-24 | Supported |
| Firefox for Android | mobile | 56 | 2017-09-28 | Supported |
| Safari on iOS | mobile | 14.5 | 2021-04-26 | Supported |
| WebView Android | mobile | 62 | 2017-10-24 | Supported |
| WebView on iOS | mobile | 14.5 | 2021-04-26 | Supported |
| Samsung Browser | mobile | 8.0 | 2018-07-18 | Supported |
| Opera | desktop | 49 | 2017-11-08 | Supported |
| Opera Android | mobile | 46 | 2018-05-14 | Supported |
| Deno | server | — | — | — |
| Node.js | server | — | — | — |
| Bun | server | — | — | — |
| Quest Browser | xr | 5.0 | 2018-07-01 | Supported |
| Internet Explorer | desktop | 10 | 2012-10-26 | Supported |