Page Visibility API

Overview

Page Visibility API allows web apps to know whether it is visible to the user or not.

It is especially useful for saving resources and improving performance by letting the app avoid performing unnecessary tasks when it is not visible.

Demo

https://nectar.website/demo/web-apis/page-visibility/

Usage

You can refer to the code present in /partials/web-apis/page-visibility.html file and use it accordingly.

Reference

https://developer.mozilla.org/en-US/docs/Web/API/Page_Visibility_API

Last updated