Fix crash when sanitizing HTML

merge-requests/2/head
gardenapple 3 years ago
parent 8b43a5fdc8
commit 9b43bec44e
No known key found for this signature in database
GPG Key ID: CAF17E9ABE789268

@ -590,10 +590,11 @@ function onLoadDOMError(error) {
}
function getHTML(window) {
let html = window.document.documentElement.outerHTML;
if (!args["insane"]) {
const createDOMPurify = require("dompurify");
const DOMPurify = createDOMPurify(window);
outputHTML = DOMPurify.sanitize(window.document, {IN_PLACE: true, WHOLE_DOCUMENT: true});
return DOMPurify.sanitize(html, {IN_PLACE: true, WHOLE_DOCUMENT: true});
}
return outputHTML;
return html;
}

Loading…
Cancel
Save