Add fullscreen PWA support
This commit is contained in:
9
web/src/pwa.ts
Normal file
9
web/src/pwa.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
export function registerServiceWorker() {
|
||||
if (!import.meta.env.PROD || !("serviceWorker" in navigator)) return;
|
||||
|
||||
window.addEventListener("load", () => {
|
||||
void navigator.serviceWorker.register("/sw.js").catch((error: unknown) => {
|
||||
console.warn("Sybil service worker registration failed", error);
|
||||
});
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user