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
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user