Merge pull request #7 from Setti7/master
Fix problem of multiple service workers being registered over multiple URLs
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);
|
||||
|
||||
@@ -53,7 +53,7 @@ class CreateMetaTemplateTagTest(TestCase):
|
||||
'<script type="text/javascript">',
|
||||
"if ('serviceWorker' in navigator) {",
|
||||
"navigator.serviceWorker.register('/serviceworker.js', {",
|
||||
"scope: '.'",
|
||||
"scope: '/'",
|
||||
"}).then(function (registration) {",
|
||||
"console.log('django-pwa: ServiceWorker registration successful with scope: ', registration.scope);",
|
||||
"}, function (err) {",
|
||||
|
||||
Reference in New Issue
Block a user