From 20bd22e025d5c23ffe7c10f1d0717e9cb90c7fa1 Mon Sep 17 00:00:00 2001 From: Jaifroid Date: Tue, 20 Feb 2018 16:54:41 +0000 Subject: [PATCH] Trying with document.write Former-commit-id: c59f040a2f77686d8348cf343e7e1cfbbfcf4742 [formerly 9890a4be4d4233070653207a12ea2780cce5e0f4] Former-commit-id: 28a8e1863a7124a45788c01409f1c0d0b9c05666 --- www/js/app.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/www/js/app.js b/www/js/app.js index 651f16e3..896e5e9e 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -386,7 +386,7 @@ define(['jquery', 'zimArchiveLoader', 'util', 'uiUtil', 'cookies', 'q', 'module' document.getElementById('prefix').classList.remove("dark"); } if (typeof Windows !== 'undefined') { - document.getElementById('openLocalFiles').style.display = params.rescan ? "block" : "none"; + document.getElementById('openLocalFiles').style.display = params.rescan ? "block" : "none"; } //else { // document.getElementById('rescanStorage').style.display = "none"; @@ -1556,8 +1556,8 @@ define(['jquery', 'zimArchiveLoader', 'util', 'uiUtil', 'cookies', 'q', 'module' console.time("Time to Document Ready"); //Void the iframe - console.log("# Clearing the iframe..."); - document.getElementById("articleContent").src = "about:blank"; + //console.log("# Clearing the iframe..."); + //document.getElementById("articleContent").src = "about:blank"; //Load cached start page if it exists var htmlContent = 0; @@ -1891,7 +1891,14 @@ define(['jquery', 'zimArchiveLoader', 'util', 'uiUtil', 'cookies', 'q', 'module' //Inject htmlArticle into iframe uiUtil.clear(); //Void progress messages setHomeTab(); - $('#articleContent').contents().find('body').html(htmlArticle); + var iframe = document.getElementById("articleContent"); + + var articleContent = iframe.contentDocument || iframe.contentWindow.document; + articleContent.open(); + articleContent.write(htmlArticle); + articleContent.close(); + //articleContent.documentElement.innerHTML = htmlArticle; + //$('#articleContent').contents().find('body').html(htmlArticle); setupTableOfContents(); //Hide top-level scrolling -- gets rid of interfering useless scroll bar, but re-enable for Config and About pages