title: Return confirm in JavaScript
body: <p>I have problem with return confirm in Chrome. In Firefox it is ok.</p>
  
  <pre><code>window.onbeforeunload = function() {
      var result = confirm('Really?');
  
      if(result) {
          console.log('Do something');
      }
  }
  </code></pre>
  
  <p>Any ideas?
  Thanks!</p>