Index: lib/elemHide.js |
=================================================================== |
--- a/lib/elemHide.js |
+++ b/lib/elemHide.js |
@@ -103,38 +103,38 @@ |
*/ |
add(filter) |
{ |
if (knownFilters.has(filter)) |
return; |
if (filter instanceof ElemHideException) |
{ |
- let {selector} = filter; |
- let list = exceptions.get(selector); |
+ let {code} = filter; |
+ let list = exceptions.get(code); |
if (list) |
list.push(filter); |
else |
- exceptions.set(selector, [filter]); |
+ exceptions.set(code, [filter]); |
// If this is the first exception for a previously unconditionally |
// applied element hiding selector we need to take care to update the |
// lookups. |
- let unconditionalFilterForSelector = filterBySelector.get(selector); |
+ let unconditionalFilterForSelector = filterBySelector.get(code); |
if (unconditionalFilterForSelector) |
{ |
this._addToFiltersByDomain(unconditionalFilterForSelector); |
- filterBySelector.delete(selector); |
+ filterBySelector.delete(code); |
unconditionalSelectors = null; |
} |
} |
- else if (!(filter.domains || exceptions.has(filter.selector))) |
+ else if (!(filter.domains || exceptions.has(filter.code))) |
{ |
// The new filter's selector is unconditionally applied to all domains |
- filterBySelector.set(filter.selector, filter); |
+ filterBySelector.set(filter.code, filter); |
unconditionalSelectors = null; |
} |
else |
{ |
// The new filter's selector only applies to some domains |
this._addToFiltersByDomain(filter); |
} |
@@ -149,25 +149,25 @@ |
remove(filter) |
{ |
if (!knownFilters.has(filter)) |
return; |
// Whitelisting filters |
if (filter instanceof ElemHideException) |
{ |
- let list = exceptions.get(filter.selector); |
+ let list = exceptions.get(filter.code); |
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.code) == filter) |
{ |
- filterBySelector.delete(filter.selector); |
+ filterBySelector.delete(filter.code); |
unconditionalSelectors = null; |
} |
// Conditionally applied element hiding filters |
else |
{ |
let domains = filter.domains || defaultDomains; |
for (let domain of domains.keys()) |
{ |
@@ -185,17 +185,17 @@ |
* Checks whether an exception rule is registered for a filter on a particular |
* domain. |
* @param {Filter} filter |
* @param {string} docDomain |
* @return {ElemHideException} |
*/ |
getException(filter, docDomain) |
{ |
- let list = exceptions.get(filter.selector); |
+ let list = exceptions.get(filter.code); |
if (!list) |
return null; |
for (let i = list.length - 1; i >= 0; i--) |
{ |
if (list[i].isActiveOnDomain(docDomain)) |
return list[i]; |
} |
@@ -269,17 +269,17 @@ |
{ |
if (!isIncluded) |
{ |
excluded.add(filter); |
} |
else if ((excluded.size == 0 || !excluded.has(filter)) && |
!this.getException(filter, domain)) |
{ |
- selectors.push(filter.selector); |
+ selectors.push(filter.code); |
} |
} |
} |
if (currentDomain == "") |
break; |
let nextDot = currentDomain.indexOf("."); |