Please see the GitHub repo for setup instructions.
Create a new
Visibility instance, passing the relevant callbacks you need.
isHidden(returns boolean) - manually check to see if the page is hidden.
isSupported(returns boolean) - test for Page Visibility API browser support.
destroy- remove event listener and callbacks.
Testing relies upon Karma test runner and Phantom JS. To install these dependencies, run the following command from the project root.
Then to perform a single pass of the tests run:
Supported web browsers
Visibility.js is released under open source MIT License.