Updated manifest.json and serviceworker by adding scope parameter.

This commit is contained in:
Embrace
2019-03-07 07:52:15 -03:00
parent f2fdf0c123
commit ed8dc195fb
8 changed files with 13 additions and 2 deletions

View File

@@ -5,6 +5,7 @@
"description": {{ PWA_APP_DESCRIPTION|js }},
"start_url": {{ PWA_APP_START_URL|js }},
"display": {{ PWA_APP_DISPLAY|js }},
"scope": {{ PWA_APP_SCOPE|js }},
"orientation": {{ PWA_APP_ORIENTATION|js }},
"background_color": {{ PWA_APP_BACKGROUND_COLOR|js }},
"theme_color": {{ PWA_APP_THEME_COLOR|js }},

View File

@@ -36,7 +36,7 @@
// Initialize the service worker
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('/serviceworker.js', {
scope: '/'
scope: '{{ PWA_APP_SCOPE }}'
}).then(function (registration) {
// Registration was successful
console.log('django-pwa: ServiceWorker registration successful with scope: ', registration.scope);