mirror of
https://github.com/OCA/web.git
synced 2025-02-22 13:21:25 +02:00
[FIX] web_pwa_oca : do not raise an error if service workers is disabled (only log). Otherwise, odoo is unavailable in private mode with Firefox Browser
This commit is contained in:
@@ -33,3 +33,4 @@
|
||||
doesn't send the cookie and web manifest returns 404.
|
||||
* Evaluate to support 'require' system.
|
||||
* Firefox can't detect 'standalone' mode. See https://bugzilla.mozilla.org/show_bug.cgi?id=1285858
|
||||
* Firefox disable service worker in private mode. See https://bugzilla.mozilla.org/show_bug.cgi?id=1601916
|
||||
|
||||
@@ -17,11 +17,13 @@ odoo.define("web_pwa_oca.PWAManager", function (require) {
|
||||
init: function () {
|
||||
this._super.apply(this, arguments);
|
||||
if (!('serviceWorker' in navigator)) {
|
||||
throw new Error(
|
||||
_t("Service workers are not supported! Maybe you are not using HTTPS?"));
|
||||
console.error(
|
||||
_t("Service workers are not supported! Maybe you are not using HTTPS or you work in private mode."));
|
||||
}
|
||||
else {
|
||||
this._service_worker = navigator.serviceWorker;
|
||||
this.registerServiceWorker('/service-worker.js');
|
||||
}
|
||||
this._service_worker = navigator.serviceWorker;
|
||||
this.registerServiceWorker('/service-worker.js');
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user