title: Why window.onpopstate is called twice using history.go?
body: <p>I've find this code that provides to disable browser back button using javascript. It works but when i press the back button it calls the console.log twice. Why?</p>
  
  <pre><code>history.pushState(null, null, location.href);
  window.onpopstate = function () {
      history.go(1);
      console.log("back");
  };
  </code></pre>