diff options
Diffstat (limited to 'static/js')
| -rw-r--r-- | static/js/sw_load.js | 13 | ||||
| -rw-r--r-- | static/js/sw_load.min.js | 1 |
2 files changed, 14 insertions, 0 deletions
diff --git a/static/js/sw_load.js b/static/js/sw_load.js new file mode 100644 index 0000000..b38f118 --- /dev/null +++ b/static/js/sw_load.js @@ -0,0 +1,13 @@ +if ("serviceWorker" in navigator) { + navigator.serviceWorker + .register("/sw.min.js?v=3.7.6", { scope: "/" }) + .then(() => { + console.info("SW Loaded"); + }, err => console.error("SW error: ", err)); + + navigator.serviceWorker + .ready + .then(() => { + console.info("SW Ready"); + }); +} diff --git a/static/js/sw_load.min.js b/static/js/sw_load.min.js new file mode 100644 index 0000000..c6cd8a1 --- /dev/null +++ b/static/js/sw_load.min.js @@ -0,0 +1 @@ +"serviceWorker"in navigator&&(navigator.serviceWorker.register("/sw.min.js?v=3.7.6",{scope:"/"}).then(()=>{console.info("SW Loaded")},e=>console.error("SW error: ",e)),navigator.serviceWorker.ready.then(()=>{console.info("SW Ready")}));
\ No newline at end of file |
