A cross-browser Page Visibility API shim