Просмотр исходного кода

don't remove head elements found in the body

Gildas 7 лет назад
Родитель
Сommit
03c74cb866
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      lib/single-file/doc-helper.js

+ 1 - 1
lib/single-file/doc-helper.js

@@ -43,7 +43,7 @@ this.docHelper = this.docHelper || (() => {
 		});
 		});
 		doc.head.querySelectorAll("*:not(base):not(link):not(meta):not(noscript):not(script):not(style):not(template):not(title)").forEach(element => element.hidden = true);
 		doc.head.querySelectorAll("*:not(base):not(link):not(meta):not(noscript):not(script):not(style):not(template):not(title)").forEach(element => element.hidden = true);
 		if (options.removeHiddenElements) {
 		if (options.removeHiddenElements) {
-			doc.querySelectorAll("html > body *:not(style):not(script):not(link):not(frame):not(iframe):not(object)").forEach(element => {
+			doc.querySelectorAll("html > body *:not(style):not(script):not(link):not(frame):not(iframe):not(object):not(meta):not(title):not(meta):not(noscript):not(template)").forEach(element => {
 				const style = win.getComputedStyle(element);
 				const style = win.getComputedStyle(element);
 				if (element instanceof win.HTMLElement && style && (element.hidden || style.display == "none" || ((style.opacity === 0 || style.visibility == "hidden") && !element.clientWidth && !element.clientHeight)) && !element.querySelector("iframe, frame, object[type=\"text/html\"][data]")) {
 				if (element instanceof win.HTMLElement && style && (element.hidden || style.display == "none" || ((style.opacity === 0 || style.visibility == "hidden") && !element.clientWidth && !element.clientHeight)) && !element.querySelector("iframe, frame, object[type=\"text/html\"][data]")) {
 					element.setAttribute(removedContentAttributeName(options.sessionId), "");
 					element.setAttribute(removedContentAttributeName(options.sessionId), "");