From e22ac9d920b80b577db30c5dc035348e0b91a2e9 Mon Sep 17 00:00:00 2001 From: Jaifroid Date: Sat, 21 Jan 2023 08:33:00 +0000 Subject: [PATCH] Check that SW is actually registered before using for first time --- www/js/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/js/app.js b/www/js/app.js index bfd43d21..346dee26 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -4991,7 +4991,7 @@ define(['jquery', 'zimArchiveLoader', 'uiUtil', 'util', 'utf8', 'cache', 'images return encodeURIComponent(m); }); - if (params.contentInjectionMode === 'serviceworker') { + if (params.contentInjectionMode === 'serviceworker' && navigator.serviceWorker.controller) { // Remove page max width restriction if required if (params.removePageMaxWidth) htmlArticle = removePageMaxWidth(htmlArticle); // For UWP apps, we need to add the Zoom level to the HTML if we are opening in external window