<html> <body> <p>A (mostly) empty page.</p> </body> <script> var gotHide = false; document.addEventListener("visibilitychange", function() { if (document.visibilityState !== 'visible') { gotHide = true; } }); </script> </html>