From 47b3c7ed01293760cb60b52b56fa3d0272a63774 Mon Sep 17 00:00:00 2001 From: Marks Polakovs Date: Sat, 9 May 2020 17:30:52 +0200 Subject: [PATCH] Scope service worker to root, to allow it to catch NIPSWeb --- src/serviceWorkerLoader.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/serviceWorkerLoader.ts b/src/serviceWorkerLoader.ts index 6099eab..0404fe6 100644 --- a/src/serviceWorkerLoader.ts +++ b/src/serviceWorkerLoader.ts @@ -68,7 +68,7 @@ export function register(config?: Config) { function registerValidSW(swUrl: string, config?: Config) { navigator.serviceWorker .register(swUrl, { - scope: window.location.pathname.endsWith("/") ? window.location.pathname : window.location.pathname + "/" + scope: "/" }) .then((registration) => { registration.onupdatefound = () => {