Skip to content

Commit

Permalink
Merge pull request #424 from kiwix/fallback-to-jquery-if-SW-fails-to-…
Browse files Browse the repository at this point in the history
…register

Automatically fallback to jQuery mode if the SW fails to register.
  • Loading branch information
mossroy authored Sep 22, 2018
2 parents 971da81 + 922d19a commit 666982b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions www/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,9 @@ define(['jquery', 'zimArchiveLoader', 'util', 'uiUtil', 'cookies','abstractFiles
}, function (err) {
console.error('error while registering serviceWorker', err);
refreshAPIStatus();
alert("The ServiceWorker could not be properly registered. Switching back to jQuery mode. Error message : " + err);
setContentInjectionMode("jquery");
return;
});
} else {
// We need to set this variable earlier else the ServiceWorker does not get reactivated
Expand Down

0 comments on commit 666982b

Please sign in to comment.