<script> document.addEventListener("visibilitychange", function(event) { // Send a signal to the test controller via alert. alert('visibilitychange'); }); </script>