|
|
@@ -38,7 +38,7 @@ this.singlefile.lib.helper = this.singlefile.lib.helper || (() => {
|
|
|
const LAZY_SRC_ATTRIBUTE_NAME = "data-single-file-lazy-loaded-src";
|
|
|
const STYLESHEET_ATTRIBUTE_NAME = "data-single-file-stylesheet";
|
|
|
const SELECTED_CONTENT_ATTRIBUTE_NAME = "data-single-file-selected-content";
|
|
|
- const IGNORED_REMOVED_TAG_NAMES = ["NOSCRIPT", "DISABLED-NOSCRIPT", "META", "LINK", "STYLE", "TITLE", "TEMPLATE", "SOURCE", "OBJECT", "SCRIPT"];
|
|
|
+ const IGNORED_REMOVED_TAG_NAMES = ["NOSCRIPT", "DISABLED-NOSCRIPT", "META", "LINK", "STYLE", "TITLE", "TEMPLATE", "SOURCE", "OBJECT", "SCRIPT", "HEAD"];
|
|
|
const REGEXP_SIMPLE_QUOTES_STRING = /^'(.*?)'$/;
|
|
|
const REGEXP_DOUBLE_QUOTES_STRING = /^"(.*?)"$/;
|
|
|
const FONT_WEIGHTS = {
|
|
|
@@ -282,8 +282,10 @@ this.singlefile.lib.helper = this.singlefile.lib.helper || (() => {
|
|
|
const visibility = computedStyle.getPropertyValue("visibility");
|
|
|
hidden = display == "none";
|
|
|
if (hidden) {
|
|
|
- element.setAttribute(HIDDEN_CONTENT_ATTRIBUTE_NAME, "");
|
|
|
- markedElements.push(element);
|
|
|
+ if (!IGNORED_REMOVED_TAG_NAMES.includes(element.tagName)) {
|
|
|
+ element.setAttribute(HIDDEN_CONTENT_ATTRIBUTE_NAME, "");
|
|
|
+ markedElements.push(element);
|
|
|
+ }
|
|
|
} else if ((opacity == "0" || visibility == "hidden") && element.getBoundingClientRect) {
|
|
|
const boundingRect = element.getBoundingClientRect();
|
|
|
hidden = !boundingRect.width && !boundingRect.height;
|