From 0ea1cfc8cc4d34f636ef834ff6eefd828ce1960f Mon Sep 17 00:00:00 2001 From: Max Richter Date: Thu, 10 Aug 2023 11:33:42 +0200 Subject: [PATCH] feat: add sw --- static/app.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/static/app.js b/static/app.js index 26cccaf..511aa19 100644 --- a/static/app.js +++ b/static/app.js @@ -1,10 +1,11 @@ (async function () { + console.log("Registering service worker..."); if ("serviceWorker" in navigator) { try { const registration = await navigator.serviceWorker.register( "sw.js", { - scope: "./", + scope: window.location.path, }, ); if (registration.installing) { @@ -14,6 +15,7 @@ } else if (registration.active) { console.log("Service worker active"); } + console.log(registration); } catch (error) { console.error(`Registration failed with ${error}`); }