diff options
Diffstat (limited to 'src/scripts/main.js')
-rw-r--r-- | src/scripts/main.js | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/scripts/main.js b/src/scripts/main.js index c610e83..96210b1 100644 --- a/src/scripts/main.js +++ b/src/scripts/main.js @@ -8,13 +8,17 @@ function urlExists(url) { if ("serviceWorker" in navigator) { window.addEventListener("load", function () { - for (var i = 0; i < assets.length; i++) { - urlExists(assets[i]); - } + try { + process.versions['electron']; + } catch { + for (var i = 0; i < assets.length; i++) { + urlExists(assets[i]); + } - navigator.serviceWorker - .register("scripts/service-worker.js") - .then(res => console.log("service worker registered")) - .catch(err => console.log("service worker not registered", err)) + navigator.serviceWorker + .register("scripts/service-worker.js") + .then(res => console.log("service worker registered")) + .catch(err => console.log("service worker not registered", err)) + } }) }
\ No newline at end of file |