Index: lib/elemHide.js |
diff --git a/lib/elemHide.js b/lib/elemHide.js |
index fc2226343341a5a9859c108faaa51309f2efe483..e99bb8a7f269e4df2370fb95bd950031503540b4 100644 |
--- a/lib/elemHide.js |
+++ b/lib/elemHide.js |
@@ -39,7 +39,7 @@ let keyByFilter = Object.create(null); |
/** |
* Nested lookup table, filter (or false if inactive) by filter key by domain. |
* (Only contains filters that aren't unconditionally matched for all domains.) |
- * @type {Map.<string,Object>} |
+ * @type {Map.<string,Map.<string,(Filter|boolean)>>} |
*/ |
let filtersByDomain = new Map(); |
@@ -107,12 +107,8 @@ let ElemHide = exports.ElemHide = { |
{ |
let filters = filtersByDomain.get(domain); |
if (!filters) |
- filtersByDomain.set(domain, filters = Object.create(null)); |
- |
- if (isIncluded) |
- filters[key] = filter; |
- else |
- filters[key] = false; |
+ filtersByDomain.set(domain, filters = new Map()); |
+ filters.set(key, isIncluded ? filter : false); |
} |
}, |
@@ -185,7 +181,7 @@ let ElemHide = exports.ElemHide = { |
{ |
let filters = filtersByDomain.get(domain); |
if (filters) |
- delete filters[key]; |
+ filters.delete(key); |
} |
}, |
@@ -365,13 +361,12 @@ let ElemHide = exports.ElemHide = { |
let filters = filtersByDomain.get(currentDomain); |
if (filters) |
{ |
- for (let filterKey in filters) |
+ for (let [filterKey, filter] of filters) |
{ |
if (filterKey in seenFilters) |
continue; |
seenFilters[filterKey] = true; |
- let filter = filters[filterKey]; |
if (filter && !this.getException(filter, domain)) |
{ |
selectors.push(filter.selector); |