title: How do I make a JS script continue to run after navigation (google chrome console)
body: <p>Say I have a simple script</p>
  
  <pre><code>var i = 0;
  test();
  function test() {
       console.log(i++);
       setTimeout(test, 1000);
  }
  </code></pre>
  
  <p>I put it in a Google Chrome console. How do I make it continue to run after the page navigates to another (should continue to print out numbers when browsing the web)?</p>
  
  <p>Maybe save the variable 'i' in onbeforeunload() function, and launch a new script with that saved variable?</p>