{"description":"<code>visibilitychange</code> event","mdn_url":"https://developer.mozilla.org/docs/Web/API/Document/visibilitychange_event","source_file":"api/Document.json","spec_url":["https://html.spec.whatwg.org/multipage/indices.html#event-visibilitychange","https://html.spec.whatwg.org/multipage/webappapis.html#handler-onvisibilitychange"],"status":{"deprecated":false,"experimental":false,"standard_track":true},"support":{"chrome":[{"version_added":"62"},{"notes":"The <code>onvisibilitychange</code> event handler property is not supported.","partial_implementation":true,"version_added":"33"},{"notes":"The <code>onvisibilitychange</code> event handler property is not supported.","partial_implementation":true,"prefix":"webkit","version_added":"13"}],"chrome_android":[{"version_added":"62"},{"notes":"The <code>onvisibilitychange</code> event handler property is not supported.","partial_implementation":true,"version_added":"33"},{"notes":"The <code>onvisibilitychange</code> event handler property is not supported.","partial_implementation":true,"prefix":"webkit","version_added":"18"}],"edge":[{"version_added":"18"},{"notes":"The <code>onvisibilitychange</code> event handler property is not supported.","partial_implementation":true,"version_added":"12"}],"firefox":{"version_added":"56"},"firefox_android":{"version_added":"56"},"ie":{"notes":"The <code>onvisibilitychange</code> event handler property is not supported.","partial_implementation":true,"version_added":"10"},"oculus":[{"version_added":"5.0"},{"notes":"The <code>onvisibilitychange</code> event handler property is not supported.","partial_implementation":true,"version_added":"5.0"},{"notes":"The <code>onvisibilitychange</code> event handler property is not supported.","partial_implementation":true,"prefix":"webkit","version_added":"5.0"}],"opera":[{"version_added":"49"},{"notes":"The <code>onvisibilitychange</code> event handler property is not supported.","partial_implementation":true,"version_added":"20"},{"notes":"The <code>onvisibilitychange</code> event handler property is not supported.","partial_implementation":true,"prefix":"webkit","version_added":"15"},{"notes":"The <code>onvisibilitychange</code> event handler property is not supported.","partial_implementation":true,"version_added":"12.1","version_removed":"15"}],"opera_android":[{"version_added":"46"},{"notes":"The <code>onvisibilitychange</code> event handler property is not supported.","partial_implementation":true,"version_added":"20"},{"notes":"The <code>onvisibilitychange</code> event handler property is not supported.","partial_implementation":true,"prefix":"webkit","version_added":"14"},{"notes":"The <code>onvisibilitychange</code> event handler property is not supported.","partial_implementation":true,"version_added":"12.1","version_removed":"14"}],"safari":[{"version_added":"14.1"},{"notes":"Doesn't fire the <code>visibilitychange</code> event when navigating away from a document, so also include code to check for the <code>pagehide</code> event (which does fire for that case in all current browsers). See WebKit bugs <a href='https://webkit.org/b/116769'>116769</a>, <a href='https://webkit.org/b/151234'>151234</a>, <a href='https://webkit.org/b/151610'>151610</a>, and <a href='https://webkit.org/b/194897'>194897</a>.","partial_implementation":true,"version_added":"14"},{"notes":["Doesn't fire the <code>visibilitychange</code> event when navigating away from a document, so also include code to check for the <code>pagehide</code> event (which does fire for that case in all current browsers). See WebKit bugs <a href='https://webkit.org/b/116769'>116769</a>, <a href='https://webkit.org/b/151234'>151234</a>, <a href='https://webkit.org/b/151610'>151610</a>, and <a href='https://webkit.org/b/194897'>194897</a>.","Before Safari 14, the event does not bubble, so <code>document.addEventListener('visibilitychange', ...)</code> works, but <code>window.addEventListener('visibilitychange', ...)</code> does not."],"partial_implementation":true,"version_added":"10.1"},{"notes":["Doesn't fire the <code>visibilitychange</code> event when navigating away from a document, so also include code to check for the <code>pagehide</code> event (which does fire for that case in all current browsers). See WebKit bugs <a href='https://webkit.org/b/116769'>116769</a>, <a href='https://webkit.org/b/151234'>151234</a>, <a href='https://webkit.org/b/151610'>151610</a>, and <a href='https://webkit.org/b/194897'>194897</a>.","Before Safari 14, the event does not bubble, so <code>document.addEventListener('visibilitychange', ...)</code> works, but <code>window.addEventListener('visibilitychange', ...)</code> does not.","The <code>onvisibilitychange</code> event handler property is not supported."],"partial_implementation":true,"version_added":"7"}],"safari_ios":[{"version_added":"14.5"},{"notes":"Doesn't fire the <code>visibilitychange</code> event when navigating away from a document, so also include code to check for the <code>pagehide</code> event (which does fire for that case in all current browsers). See WebKit bugs <a href='https://webkit.org/b/116769'>116769</a>, <a href='https://webkit.org/b/151234'>151234</a>, <a href='https://webkit.org/b/151610'>151610</a>, and <a href='https://webkit.org/b/194897'>194897</a>.","partial_implementation":true,"version_added":"14"},{"notes":["Doesn't fire the <code>visibilitychange</code> event when navigating away from a document, so also include code to check for the <code>pagehide</code> event (which does fire for that case in all current browsers). See WebKit bugs <a href='https://webkit.org/b/116769'>116769</a>, <a href='https://webkit.org/b/151234'>151234</a>, <a href='https://webkit.org/b/151610'>151610</a>, and <a href='https://webkit.org/b/194897'>194897</a>.","Before Safari 14, the event does not bubble, so <code>document.addEventListener('visibilitychange', ...)</code> works, but <code>window.addEventListener('visibilitychange', ...)</code> does not."],"partial_implementation":true,"version_added":"10.3"},{"notes":["Doesn't fire the <code>visibilitychange</code> event when navigating away from a document, so also include code to check for the <code>pagehide</code> event (which does fire for that case in all current browsers). See WebKit bugs <a href='https://webkit.org/b/116769'>116769</a>, <a href='https://webkit.org/b/151234'>151234</a>, <a href='https://webkit.org/b/151610'>151610</a>, and <a href='https://webkit.org/b/194897'>194897</a>.","Before Safari 14, the event does not bubble, so <code>document.addEventListener('visibilitychange', ...)</code> works, but <code>window.addEventListener('visibilitychange', ...)</code> does not.","The <code>onvisibilitychange</code> event handler property is not supported."],"partial_implementation":true,"version_added":"7"}],"samsunginternet_android":[{"version_added":"8.0"},{"notes":"The <code>onvisibilitychange</code> event handler property is not supported.","partial_implementation":true,"version_added":"2.0"},{"notes":"The <code>onvisibilitychange</code> event handler property is not supported.","partial_implementation":true,"prefix":"webkit","version_added":"1.0"}],"webview_android":[{"version_added":"62"},{"notes":"The <code>onvisibilitychange</code> event handler property is not supported.","partial_implementation":true,"version_added":"4.4.3"},{"notes":"The <code>onvisibilitychange</code> event handler property is not supported.","partial_implementation":true,"prefix":"webkit","version_added":"≤37"}]}}