A cross-browser Page Visibility API polyfill