Index: lib/elemHide.js |
=================================================================== |
--- a/lib/elemHide.js |
+++ b/lib/elemHide.js |
@@ -70,17 +70,17 @@ |
* @param {Filter} filter |
*/ |
function addToFiltersByDomain(filter) |
{ |
let domains = filter.domains || defaultDomains; |
for (let [domain, isIncluded] of domains) |
{ |
// There's no need to note that a filter is generically disabled. |
- if (!isIncluded && domain == "") |
+ if (!isIncluded && domain === "") |
continue; |
let filters = filtersByDomain.get(domain); |
if (!filters) |
filtersByDomain.set(domain, filters = new Map()); |
filters.set(filter, isIncluded); |
} |
} |
@@ -174,17 +174,17 @@ |
if (filter instanceof ElemHideException) |
{ |
let list = exceptions.get(filter.selector); |
let index = list.indexOf(filter); |
if (index >= 0) |
list.splice(index, 1); |
} |
// Unconditially applied element hiding filters |
- else if (filterBySelector.get(filter.selector) == filter) |
+ else if (filterBySelector.get(filter.selector) === filter) |
{ |
filterBySelector.delete(filter.selector); |
unconditionalSelectors = null; |
} |
// Conditionally applied element hiding filters |
else |
{ |
let domains = filter.domains || defaultDomains; |
@@ -235,41 +235,41 @@ |
let excluded = new Set(); |
let currentDomain = domain ? domain.replace(/\.+$/, "").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) |
{ |
- if (specificOnly && currentDomain == "") |
+ if (specificOnly && currentDomain === "") |
break; |
let filters = filtersByDomain.get(currentDomain); |
if (filters) |
{ |
for (let [filter, isIncluded] of filters) |
{ |
if (!isIncluded) |
{ |
excluded.add(filter); |
} |
- else if ((excluded.size == 0 || !excluded.has(filter)) && |
+ else if ((excluded.size === 0 || !excluded.has(filter)) && |
!this.getException(filter, domain)) |
{ |
selectors.push(filter.selector); |
} |
} |
} |
- if (currentDomain == "") |
+ if (currentDomain === "") |
break; |
let nextDot = currentDomain.indexOf("."); |
- currentDomain = nextDot == -1 ? "" : currentDomain.substr(nextDot + 1); |
+ currentDomain = nextDot === -1 ? "" : currentDomain.substr(nextDot + 1); |
} |
if (!specificOnly) |
selectors = getUnconditionalSelectors().concat(selectors); |
return selectors; |
} |
}; |