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:
Jaifroid 2018-11-23 19:05:24 +00:00
parent 8462497ac4
commit 80e5461d35

View File

@ -2173,10 +2173,9 @@ define(['jquery', 'zimArchiveLoader', 'util', 'uiUtil', 'cookies', 'q', 'module'
$('#articleListHeaderMessage').empty();
$('#articleListWithHeader').hide();
$("#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;
// Inject the new article's HTML into the iframe
articleContent.documentElement.innerHTML = htmlArticle;
// Add any missing classes stripped from the <html> tag
if (htmlCSS) articleContent.getElementsByTagName('body')[0].classList.add(htmlCSS);
// 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)
//iframeArticleContent.src = "article.html";
var articleContent = iframeArticleContent.contentDocument;
articleContent.open('text/html', 'replace');
articleContent.write("<!DOCTYPE html>"); // Ensures browsers parse iframe in Standards mode
articleContent.write(htmlArticle);
articleContent.close();
iframeArticleContent.src = "article.html";
//var articleContent = iframeArticleContent.contentDocument;
//articleContent.open('text/html', 'replace');
//articleContent.write("<!DOCTYPE html>"); // Ensures browsers parse iframe in Standards mode
//articleContent.write(htmlArticle);
//articleContent.close();
} // End of injectHtml