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.
https://nectar.website/demo/web-apis/page-visibility/arrow-up-right
You can refer to the code present in /partials/web-apis/page-visibility.html file and use it accordingly.
/partials/web-apis/page-visibility.html
https://developer.mozilla.org/en-US/docs/Web/API/Page_Visibility_APIarrow-up-right
Last updated 2 years ago