From ab8db72bd3aad26848276456aaba381de12e8926 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Setti?= Date: Fri, 8 Feb 2019 02:20:26 -0200 Subject: [PATCH] Fix problem of multiple service workers being registered Source: https://stackoverflow.com/questions/33816342/how-to-prevent-the-same-service-worker-from-registering-over-multiple-pages --- pwa/templates/pwa.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pwa/templates/pwa.html b/pwa/templates/pwa.html index b148acc..660763c 100644 --- a/pwa/templates/pwa.html +++ b/pwa/templates/pwa.html @@ -36,7 +36,7 @@ // Initialize the service worker if ('serviceWorker' in navigator) { navigator.serviceWorker.register('/serviceworker.js', { - scope: '.' + scope: '/' }).then(function (registration) { // Registration was successful console.log('django-pwa: ServiceWorker registration successful with scope: ', registration.scope);