Skip to content

Commit

Permalink
Default to Service Worker mode when accessing app as PWA #808 (#809)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaifroid authored Jan 31, 2022
1 parent 1fa345b commit 0a78496
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion www/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ define(['jquery', 'zimArchiveLoader', 'uiUtil', 'settingsStore','abstractFilesys
// A parameter to access the URL of any extension that this app was launched from
params['referrerExtensionURL'] = settingsStore.getItem('referrerExtensionURL');
// A parameter to set the content injection mode ('jquery' or 'serviceworker') used by this app
params['contentInjectionMode'] = settingsStore.getItem('contentInjectionMode') || 'jquery'; // Defaults to jquery for now
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';

// An object to hold the current search and its state (allows cancellation of search across modules)
appstate['search'] = {
Expand Down

0 comments on commit 0a78496

Please sign in to comment.