From 2fb013081fdd9e915cf2c9516caacf1ea83e7bde Mon Sep 17 00:00:00 2001 From: Jaifroid Date: Sun, 6 Dec 2020 14:29:34 +0000 Subject: [PATCH] Explain reason for not using onload event --- www/js/app.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/www/js/app.js b/www/js/app.js index 01b2c85b8..e16d24243 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -1350,8 +1350,9 @@ define(['jquery', 'zimArchiveLoader', 'uiUtil', 'settingsStore','abstractFilesys articleContainer.document.write(htmlArticle); articleContainer.document.close(); if (appstate.target === 'window') articleContainer.onpopstate = historyPop; - // DEV: It is technically not necessary to load the window in a function, but since different versions of the loading algorithm - // have used an .onload event, or check document.readyState, it is useful to group the functions together like this + // DEV: we can no longer use articleContainer.onload to run this function because IE (and Edge Legacy) do not provide the + // onload event for newly opened windows/tabs. However, document.write followed by document.close is synchronous, so an + // event loader should not be necessary windowLoaded(); // Calculate the current article's ZIM baseUrl to use when processing relative links