title: Firefox beforeunload throws security error on localhost
body: <p>Localhost development throwing security_manager_veto errors during certain interactions with the beforeunload event.</p>
  
  <p>The default "leave the page" warning shows up and pressing cancel and then refresh or just refresh while the dialog was open kept throwing the error.</p>
  
  <p>Mozilla's suggestion for preventing the popup</p>
  
  <pre><code>window.addEventListener("beforeunload", function (e) {
      var confirmationMessage = false;
  
       e.returnValue = confirmationMessage;     // Gecko, Trident, Chrome 34+
      return confirmationMessage;              // Gecko, WebKit, Chrome &lt;34
   });
  </code></pre>
  
  <p>Was ineffective.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Problem was due to jquery handling beforeunload events in the background.</p>
  
  <p>Using the answers on another SO question <a href="https://stackoverflow.com/questions/4787995/how-to-disable-beforeunload-action-when-user-is-submitting-a-form">here</a> and unbinding the onbeforeunload using jquery, the problem was fixed.</p>