Chrome extension: Execute background page only once when chrome starts
I am playing with chrome extensions, my manifest loads a background page with:
...
"background": { "scripts": ["background_page.js"], "persistent": false },
...
The .js code looks like this:
var once = false;
window.addEventListener("load", function () {
if ( once == true ) { return; }
alert( 'test' );
once = …