title: Google Chrome 20 and unload event
body: <p>I need to execute some JavaScript code when user try to close the page, and I know that in google chrome <code>unload</code> event is not always fired. I tried some workaround but from last update (chrome 20.0.xxx) nothing seems to work.</p>
  <pre><code>window.onbeforeunload = function() {
      ...
  }
  
  window.onpagehide = function() {
      ...
  }
  </code></pre>
  <p>Is there another way (without using an external library)?</p>