api.Document.visibilitychange_event

Spec

MDN URL

Status

On the standards track: Yes

Is Experimental: No

Is Deprecated: No

Browser Support

In Chrome version 62 on 2017-10-17 Note: The onvisibilitychange event handler property is not supported. The onvisibilitychange event handler property is not supported.

In Chrome Android version 62 on 2017-10-24 Note: The onvisibilitychange event handler property is not supported. The onvisibilitychange event handler property is not supported.

In Edge version 18 on 2018-10-02 Note: The onvisibilitychange event handler property is not supported.

In Firefox version 56 on 2017-09-28

In Firefox for Android version 56 on 2017-09-28

In Internet Explorer version 10 on 2012-10-26 Note: The onvisibilitychange event handler property is not supported.

In Quest Browser version 5.0 on undefined Note: The onvisibilitychange event handler property is not supported.

In Opera version 49 on 2017-11-08 Note: The onvisibilitychange event handler property is not supported. The onvisibilitychange event handler property is not supported. The onvisibilitychange event handler property is not supported.

In Opera Android version 46 on 2018-05-14 Note: The onvisibilitychange event handler property is not supported. The onvisibilitychange event handler property is not supported. The onvisibilitychange event handler property is not supported.

In Safari version 14.1 on 2021-04-26 Note: 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. 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. Before Safari 14, the event does not bubble, so document.addEventListener('visibilitychange', ...) works, but window.addEventListener('visibilitychange', ...) does not. 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. Before Safari 14, the event does not bubble, so document.addEventListener('visibilitychange', ...) works, but window.addEventListener('visibilitychange', ...) does not. The onvisibilitychange event handler property is not supported.

In Safari on iOS version 14.5 on 2021-04-26 Note: 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. 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. Before Safari on iOS 14, the event does not bubble, so document.addEventListener('visibilitychange', ...) works, but window.addEventListener('visibilitychange', ...) does not. 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. Before Safari on iOS 14, the event does not bubble, so document.addEventListener('visibilitychange', ...) works, but window.addEventListener('visibilitychange', ...) does not. The onvisibilitychange event handler property is not supported.

In Samsung Internet version 8.0 on 2018-07-18 Note: The onvisibilitychange event handler property is not supported. The onvisibilitychange event handler property is not supported.

In WebView Android version 62 on 2017-10-24 Note: The onvisibilitychange event handler property is not supported. The onvisibilitychange event handler property is not supported.

In WebView on iOS version 14.5 on 2021-04-26 Note: 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. 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. Before WebView on iOS 14, the event does not bubble, so document.addEventListener('visibilitychange', ...) works, but window.addEventListener('visibilitychange', ...) does not. 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. Before WebView on iOS 14, the event does not bubble, so document.addEventListener('visibilitychange', ...) works, but window.addEventListener('visibilitychange', ...) does not. The onvisibilitychange event handler property is not supported.