mirror of
https://github.com/kiwix/kiwix-js-pwa.git
synced 2025-09-10 04:40:27 -04:00
Reverted to innerhtml to prevent crashes until we enable JS in the ZIM
Former-commit-id: 9b8cb5272274c7a6e26157d22aaca495db25f188 [formerly f1729a50b0e291e024a4a3c450294dd724c83f42] Former-commit-id: 362eeb0cc85f2bdf5d25658dc8f7a16a2cc97eab
This commit is contained in:
parent
8462497ac4
commit
80e5461d35
@ -2173,10 +2173,9 @@ define(['jquery', 'zimArchiveLoader', 'util', 'uiUtil', 'cookies', 'q', 'module'
|
|||||||
$('#articleListHeaderMessage').empty();
|
$('#articleListHeaderMessage').empty();
|
||||||
$('#articleListWithHeader').hide();
|
$('#articleListWithHeader').hide();
|
||||||
$("#prefix").val("");
|
$("#prefix").val("");
|
||||||
// Inject the new article's HTML into the iframe
|
|
||||||
//var articleDoc = iframeArticleContent.contentDocument.documentElement;
|
|
||||||
//articleDoc.innerHTML = htmlArticle;
|
|
||||||
var articleContent = document.getElementById('articleContent').contentDocument;
|
var articleContent = document.getElementById('articleContent').contentDocument;
|
||||||
|
// Inject the new article's HTML into the iframe
|
||||||
|
articleContent.documentElement.innerHTML = htmlArticle;
|
||||||
// Add any missing classes stripped from the <html> tag
|
// Add any missing classes stripped from the <html> tag
|
||||||
if (htmlCSS) articleContent.getElementsByTagName('body')[0].classList.add(htmlCSS);
|
if (htmlCSS) articleContent.getElementsByTagName('body')[0].classList.add(htmlCSS);
|
||||||
// Allow back/forward in browser history
|
// Allow back/forward in browser history
|
||||||
@ -2364,12 +2363,12 @@ define(['jquery', 'zimArchiveLoader', 'util', 'uiUtil', 'cookies', 'q', 'module'
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Load the blank article to clear the iframe (NB iframe onload event runs *after* this)
|
// Load the blank article to clear the iframe (NB iframe onload event runs *after* this)
|
||||||
//iframeArticleContent.src = "article.html";
|
iframeArticleContent.src = "article.html";
|
||||||
var articleContent = iframeArticleContent.contentDocument;
|
//var articleContent = iframeArticleContent.contentDocument;
|
||||||
articleContent.open('text/html', 'replace');
|
//articleContent.open('text/html', 'replace');
|
||||||
articleContent.write("<!DOCTYPE html>"); // Ensures browsers parse iframe in Standards mode
|
//articleContent.write("<!DOCTYPE html>"); // Ensures browsers parse iframe in Standards mode
|
||||||
articleContent.write(htmlArticle);
|
//articleContent.write(htmlArticle);
|
||||||
articleContent.close();
|
//articleContent.close();
|
||||||
|
|
||||||
} // End of injectHtml
|
} // End of injectHtml
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user