Merge pull request #815 from kiwix/fix-warning-on-each-start-when-SW-not-supported

Fix warning on each start when ServiceWorker is not supported
This commit is contained in:
Mossroy 2022-02-05 09:27:43 +01:00 committed by GitHub
commit 05db48d2a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -95,7 +95,7 @@ define(['jquery', 'zimArchiveLoader', 'uiUtil', 'settingsStore','abstractFilesys
// A parameter to set the content injection mode ('jquery' or 'serviceworker') used by this app
params['contentInjectionMode'] = settingsStore.getItem('contentInjectionMode') ||
// Defaults to jquery in extensions, and serviceworker if accessing as a PWA
(/^https?:$/i.test(window.location.protocol) && isServiceWorkerAvailable()) ? 'serviceworker' : 'jquery';
((/^https?:$/i.test(window.location.protocol) && isServiceWorkerAvailable()) ? 'serviceworker' : 'jquery');
// An object to hold the current search and its state (allows cancellation of search across modules)
appstate['search'] = {