Index: lib/elemHide.js |
=================================================================== |
--- a/lib/elemHide.js |
+++ b/lib/elemHide.js |
@@ -67,16 +67,20 @@ |
/** |
* Adds a filter to the lookup table of filters by domain. |
* @param {Filter} filter |
*/ |
function addToFiltersByDomain(filter) |
{ |
let domains = filter.domains || defaultDomains; |
+ |
+ if (typeof domains == "string") |
+ domains = [[domains, true]]; |
+ |
for (let [domain, isIncluded] of domains) |
{ |
// There's no need to note that a filter is generically disabled. |
if (!isIncluded && domain == "") |
continue; |
let filters = filtersByDomain.get(domain); |
if (!filters) |
@@ -183,17 +187,21 @@ |
{ |
filterBySelector.delete(filter.selector); |
unconditionalSelectors = null; |
} |
// Conditionally applied element hiding filters |
else |
{ |
let domains = filter.domains || defaultDomains; |
- for (let domain of domains.keys()) |
+ |
+ if (typeof domains == "string") |
+ domains = [[domains]]; |
+ |
+ for (let [domain] of domains) |
{ |
let filters = filtersByDomain.get(domain); |
if (filters) |
filters.delete(filter); |
} |
} |
knownFilters.delete(filter); |