You can read more about visibilityState on the Mozilla Developer Network.
Please Don’t Go is available on Bower and GitHub.
bower install pleaseDontGo
Download the script or the minified version in the
How to Use
The plugin will look for the first HTML element with
rel="icon", so make sure that’s your favicon.
<link rel="icon" type="image/x-icon" href="path/to/favicon.ico">
Please Don’t Go has defaults for or allows you to set the new title, the path for the new favicon, and the timeout for when it switches over when a user clicks a new tab.