Index: test/filterClasses.js |
=================================================================== |
--- a/test/filterClasses.js |
+++ b/test/filterClasses.js |
@@ -66,20 +66,27 @@ |
{ |
result.push("disabled=" + filter.disabled); |
result.push("lastHit=" + filter.lastHit); |
result.push("hitCount=" + filter.hitCount); |
let domains = []; |
if (filter.domains) |
{ |
- for (let [domain, isIncluded] of filter.domains) |
+ if (typeof filter.domains == "string") |
+ { |
+ domains.push(filter.domains); |
+ } |
+ else |
{ |
- if (domain != "") |
- domains.push(isIncluded ? domain : "~" + domain); |
+ for (let [domain, isIncluded] of filter.domains) |
+ { |
+ if (domain != "") |
+ domains.push(isIncluded ? domain : "~" + domain); |
+ } |
} |
} |
result.push("domains=" + domains.sort().join("|")); |
if (filter instanceof RegExpFilter) |
{ |
result.push("regexp=" + filter.regexp.source); |
result.push("contentType=" + filter.contentType); |
@@ -103,18 +110,20 @@ |
{ |
if (filter instanceof ElemHideFilter) |
result.push("type=elemhide"); |
else if (filter instanceof ElemHideException) |
result.push("type=elemhideexception"); |
else if (filter instanceof ElemHideEmulationFilter) |
result.push("type=elemhideemulation"); |
+ let filterDomains = typeof filter.domains == "string" ? |
+ [[filter.domains, true]] : filter.domains; |
result.push("selectorDomains=" + |
- [...filter.domains || []] |
+ [...filterDomains || []] |
.filter(([domain, isIncluded]) => isIncluded) |
.map(([domain]) => domain.toLowerCase())); |
result.push("selector=" + filter.selector); |
} |
} |
return result; |
} |