mirror of
https://github.com/kiwix/kiwix-js-pwa.git
synced 2025-09-08 03:37:12 -04:00
Trying with document.write
Former-commit-id: c59f040a2f77686d8348cf343e7e1cfbbfcf4742 [formerly 9890a4be4d4233070653207a12ea2780cce5e0f4] Former-commit-id: 28a8e1863a7124a45788c01409f1c0d0b9c05666
This commit is contained in:
parent
0562e1762a
commit
20bd22e025
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user