Index: lib/elemHide.js |
=================================================================== |
--- a/lib/elemHide.js |
+++ b/lib/elemHide.js |
@@ -241,20 +241,22 @@ |
* ElemHide.SPECIFIC_ONLY. |
* @returns {string[]} |
* List of selectors. |
*/ |
getSelectorsForDomain(domain, criteria) |
{ |
let selectors = []; |
+ let unconditionalSelectors = null; |
+ |
if (typeof criteria == "undefined") |
criteria = ElemHide.ALL_MATCHING; |
if (criteria < ElemHide.NO_UNCONDITIONAL) |
- selectors = this.getUnconditionalSelectors(); |
+ unconditionalSelectors = this.getUnconditionalSelectors(); |
let specificOnly = (criteria >= ElemHide.SPECIFIC_ONLY); |
let excluded = new Set(); |
let currentDomain = domain ? domain.toUpperCase() : ""; |
// This code is a performance hot-spot, which is why we've made certain |
// micro-optimisations. Please be careful before making changes. |
while (true) |
@@ -281,11 +283,14 @@ |
if (currentDomain == "") |
break; |
let nextDot = currentDomain.indexOf("."); |
currentDomain = nextDot == -1 ? "" : currentDomain.substr(nextDot + 1); |
} |
+ if (unconditionalSelectors) |
+ selectors = unconditionalSelectors.concat(selectors); |
+ |
return selectors; |
} |
}; |