<script>
  var visibilityChanged = function() {
    steroids.logger.log("FROM PRELOADED VIEW window.location: " + window.location.href + ", document.visibilityState == " + document.visibilityState + " && document.hidden ==" + document.hidden);
    alert("FROM PRELOADED VIEW window.location: " + window.location.href + ", document.visibilityState == " + document.visibilityState + " && document.hidden ==" + document.hidden);
  }

  steroids.on("ready", function() {
    document.addEventListener("visibilitychange", visibilityChanged);
  });
</script>

<h2>hi i have eventlisteners on visibilitychange</h2>