From 717ddb3884b75aae87eead33fea86a53644473dc Mon Sep 17 00:00:00 2001 From: William Brawner Date: Fri, 4 Feb 2022 21:09:27 -0700 Subject: [PATCH] Register service worker with root scope --- client/src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/index.ts b/client/src/index.ts index 6200c07..6911ea6 100644 --- a/client/src/index.ts +++ b/client/src/index.ts @@ -1,7 +1,7 @@ let socket: WebSocket | null = null; if ('serviceWorker' in navigator) { - navigator.serviceWorker.register('/static/js/sw.js') + navigator.serviceWorker.register('/static/js/sw.js', { 'scope': '/' }) .then(function (registration) { console.log('Registration successful, scope is:', registration.scope); })