title: onbeforeunload issue with Chrome and Firefox
body: <p>In last days I noticed that the confirmation alert that I supposed to see before leaving my website page is no more shown on Chrome and Firefox, but it's displayed on IE.
  If I debug with Google Chrome Dev Tools, I can see that function confirm is executed, enters the if statement, but no alert box is displayed. I tried to restart Google Chrome and look for an option to reset alert messages, but I didn't find nothing.
  Any ideas?</p>
  
  <p>The code is this:</p>
  
  <pre><code>if (window.addEventListener) {
                      window.addEventListener('beforeunload', confirm, false);
                  }
                  else window.attachEvent("onbeforeunload", confirm);
  
  ...
  
  function confirm(e) {
      if (changed== true) {
          return "You haven't saved your changes!";
      }
  }
  </code></pre>