title: can't get onbeforeunload working in chrome
body: <p>I've looked at similar questions on this website, but I haven't seen why this doesn't work for me.</p>
  
  <p>I have the latest version of chrome installed. <br />
  I can't seem to get the following code to work in chrome, it works in firefox though.  </p>
  
  <pre><code>Hello World!
  
  &lt;script&gt;
      window.onbeforeunload = function(){
          alert("brohan");
      }
  &lt;/script&gt;
  </code></pre>