forked from MapComplete/MapComplete
Refactoring: make needed URLs explicit
This commit is contained in:
parent
7852829f1b
commit
4852888b41
51 changed files with 978 additions and 871 deletions
13
src/InstallServiceWorker.ts
Normal file
13
src/InstallServiceWorker.ts
Normal file
|
@ -0,0 +1,13 @@
|
|||
export {}
|
||||
window.addEventListener("load", async () => {
|
||||
if (!("serviceWorker" in navigator)) {
|
||||
console.log("Service workers are not supported")
|
||||
return
|
||||
}
|
||||
try {
|
||||
await navigator.serviceWorker.register("/service-worker.js")
|
||||
console.log("Service worker registration successful")
|
||||
} catch (err) {
|
||||
console.error("Service worker registration failed", err)
|
||||
}
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue