diff --git a/pwa/app_settings.py b/pwa/app_settings.py index 3ecd5f9..444a5a6 100644 --- a/pwa/app_settings.py +++ b/pwa/app_settings.py @@ -14,6 +14,7 @@ PWA_APP_THEME_COLOR = getattr(settings, 'PWA_APP_THEME_COLOR', '#000') PWA_APP_BACKGROUND_COLOR = getattr(settings, 'PWA_APP_BACKGROUND_COLOR', '#fff') PWA_APP_DISPLAY = getattr(settings, 'PWA_APP_DISPLAY', 'standalone') PWA_APP_SCOPE = getattr(settings, 'PWA_APP_SCOPE', '/') +PWA_APP_DEBUG_MODE = getattr(settings, 'PWA_APP_DEBUG_MODE', True) PWA_APP_ORIENTATION = getattr(settings, 'PWA_APP_ORIENTATION', 'any') PWA_APP_START_URL = getattr(settings, 'PWA_APP_START_URL', '/') PWA_APP_FETCH_URL = getattr(settings, 'PWA_APP_FETCH_URL', '/') diff --git a/pwa/templates/pwa.html b/pwa/templates/pwa.html index 00c897f..fb4b8f1 100644 --- a/pwa/templates/pwa.html +++ b/pwa/templates/pwa.html @@ -39,10 +39,14 @@ scope: '{{ PWA_APP_SCOPE }}' }).then(function (registration) { // Registration was successful + {% if PWA_APP_DEBUG_MODE %} console.log('django-pwa: ServiceWorker registration successful with scope: ', registration.scope); + {% endif %} }, function (err) { // registration failed :( + {% if PWA_APP_DEBUG_MODE %} console.log('django-pwa: ServiceWorker registration failed: ', err); + {% endif %} }); }