| Index: lib/elemHide.js |
| =================================================================== |
| --- a/lib/elemHide.js |
| +++ b/lib/elemHide.js |
| @@ -89,17 +89,17 @@ |
| * Returns a list of selectors that apply on each website unconditionally. |
| * @returns {string[]} |
| */ |
| function getUnconditionalSelectors() |
| { |
| if (!unconditionalSelectors) |
| unconditionalSelectors = [...filterBySelector.keys()]; |
| - return unconditionalSelectors.slice(); |
| + return unconditionalSelectors; |
| } |
| /** |
| * Container for element hiding filters |
| * @class |
| */ |
| let ElemHide = exports.ElemHide = { |
| /** |
| @@ -255,19 +255,16 @@ |
| * ElemHide.SPECIFIC_ONLY. |
| * @returns {string[]} |
| * List of selectors. |
| */ |
| getSelectorsForDomain(domain, criteria = ElemHide.ALL_MATCHING) |
| { |
| let selectors = []; |
| - if (criteria < ElemHide.NO_UNCONDITIONAL) |
| - selectors = 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) |
| { |
| @@ -293,11 +290,14 @@ |
| if (currentDomain == "") |
| break; |
| let nextDot = currentDomain.indexOf("."); |
| currentDomain = nextDot == -1 ? "" : currentDomain.substr(nextDot + 1); |
| } |
| + if (criteria < ElemHide.NO_UNCONDITIONAL) |
| + selectors = getUnconditionalSelectors().concat(selectors); |
| + |
| return selectors; |
| } |
| }; |