title: Chrome extension: Execute background page only once when chrome starts
body: <p>I am playing with chrome extensions, my manifest loads a background page with:</p>
  <pre><code>...
  &quot;background&quot;: { &quot;scripts&quot;: [&quot;background_page.js&quot;], &quot;persistent&quot;: false },
  ...
  </code></pre>
  <p>The <code>.js</code> code looks like this:</p>
  <pre class="lang-js prettyprint-override"><code>var once = false;
  window.addEventListener(&quot;load&quot;, function () {
    if ( once == true ) { return; }
    alert( 'test' );
    once = true;
  }, false);
  </code></pre>
  <p>This seems to works fine, but i want to run the <code>background_page.js</code> code only once every time the browser starts.</p>
  <p>Right now, I am not sure why, but the code is executed more than once. At first I thought it was being executed every time I open a new tab but that's not the case. The alert does appear once I start the browser, then if I open a new tab quickly the alert wont appear, but if I wait about 1 minute or so and open a new tab then the alert appears again.</p>
  <p><strong>How can i make sure the <code>background_page.js</code> code runs only once every time the browser starts?</strong></p>