From b6bd196bc22024f3404104003952c5f88bcd828c Mon Sep 17 00:00:00 2001 From: Jaifroid Date: Mon, 14 Jun 2021 15:38:21 +0100 Subject: [PATCH] Improve composition for non-MS browsers Former-commit-id: a8637b15af7ae2132c7712b4b20e70815d91e559 [formerly a1271a15007ff9482e5ddaacfe9d0d79ae6de0e7 [formerly fe38645eaccfe182c8796d8e50ed2c370ef1c0fd]] Former-commit-id: ffb204447e52cde9485deb2ca98c527405b050a2 Former-commit-id: 59ed13ac7dc0a3e40b8a20368ce0480457bfb481 --- package.json | 4 +--- www/js/app.js | 12 +++++++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 1c5f95b9..a73b7c6b 100644 --- a/package.json +++ b/package.json @@ -88,6 +88,4 @@ "dependencies": { "@types/fs-extra": "^9.0.11" } -} - - +} diff --git a/www/js/app.js b/www/js/app.js index 71e43e21..18d85cff 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -3826,12 +3826,18 @@ define(['jquery', 'zimArchiveLoader', 'uiUtil', 'util', 'cache', 'images', 'sett // Make sure the article area is displayed setTab(); checkToolbar(); - // setTimeout(function() { + var showArticle = function () { articleDocument.bgcolor = ""; articleDocument.hidden = false; articleWindow.document.body.hidden = false; - // }, 0); - + }; + if ('MSBlobBuilder' in window) { + // For legacy MS browsers, including UWP, delay causes blank screen on slow systems + showArticle(); + } else { + // For Chromium browsers a small delay greatly improves composition + setTimeout(showArticle, 80); + } }; // For articles loaded in the iframe, we need to set the articleWindow (but if the user is opening a new tab/window,