Automatically fallback to jQuery mode if the SW fails to register.

Fixes #405
This commit is contained in:
Mossroy 2018-09-22 11:57:34 +02:00
parent 971da815b5
commit 922d19aa01

View File

@ -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