title: How to detect browser support for pageShow and pageHide?
body: <p>How can we do JavaScript object detection for <a href="https://developer.mozilla.org/en/Using_Firefox_1.5_caching" rel="noreferrer">pageShow and pageHide</a> handlers?</p>
  
  <pre><code>if( /* pagehide is supported */ ){
     window.addEventListener('pagehide', exitFunction, false);
  }
  else{
      window.addEventListener('unload', exitFunction, false);
  }
  </code></pre>