|
|
@@ -27,6 +27,8 @@ this.singlefile.lib.modules.matchedRules = this.singlefile.lib.modules.matchedRu
|
|
|
|
|
|
const MEDIA_ALL = "all";
|
|
|
const IGNORED_PSEUDO_ELEMENTS = ["after", "before", "first-letter", "first-line", "placeholder", "selection"];
|
|
|
+ const SINGLE_FILE_HIDDEN_CLASS_NAME = "sf-hidden";
|
|
|
+ const DISPLAY_STYLE = "display";
|
|
|
const REGEXP_VENDOR_IDENTIFIER = /-(ms|webkit|moz|o)-/;
|
|
|
const DEBUG = false;
|
|
|
|
|
|
@@ -140,6 +142,12 @@ this.singlefile.lib.modules.matchedRules = this.singlefile.lib.modules.matchedRu
|
|
|
if (!matchedElements) {
|
|
|
try {
|
|
|
matchedElements = doc.querySelectorAll(selectorText);
|
|
|
+ if (selectorText != "." + SINGLE_FILE_HIDDEN_CLASS_NAME) {
|
|
|
+ matchedElements = Array.from(doc.querySelectorAll(selectorText)).filter(matchedElement =>
|
|
|
+ !matchedElement.classList.contains(SINGLE_FILE_HIDDEN_CLASS_NAME) &&
|
|
|
+ (matchedElement.style.getPropertyValue(DISPLAY_STYLE) != "none" || matchedElement.style.getPropertyPriority("display") != "important")
|
|
|
+ );
|
|
|
+ }
|
|
|
} catch (error) {
|
|
|
// ignored
|
|
|
}
|