With the Page Visibility API your web application can know whether a user is viewing your page or not. This opens the door for some interesting user experiences.

#javascript

How to Detect If a User Is Viewing Your Web App | Page Visibility API in JavaScript
1.25 GEEK