mirror of
https://github.com/Retrospring/retrospring.git
synced 2025-02-07 16:13:36 +01:00
only initialize service workers if they are available
This commit is contained in:
parent
87813d3005
commit
3aa18ef7c7
1 changed files with 3 additions and 1 deletions
|
@ -1,3 +1,5 @@
|
||||||
export default function (): void {
|
export default function (): void {
|
||||||
|
if ('serviceWorker' in navigator) {
|
||||||
navigator.serviceWorker.register("/service_worker.js", { scope: "/" });
|
navigator.serviceWorker.register("/service_worker.js", { scope: "/" });
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue