if (window.localStorage.getItem("installed") == undefined) { /* run function */ window.localStorage.setItem("installed", true); }