Index: lib/elemHide.js |
=================================================================== |
--- a/lib/elemHide.js |
+++ b/lib/elemHide.js |
@@ -112,65 +112,65 @@ |
*/ |
add(filter) |
{ |
if (filter instanceof ElemHideException) |
{ |
if (knownExceptions.has(filter.text)) |
return; |
- 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 filterKey = filterKeyBySelector.get(selector); |
+ let filterKey = filterKeyBySelector.get(code); |
if (typeof filterKey != "undefined") |
{ |
this._addToFiltersByDomain(filterKey, filterByKey[filterKey]); |
- filterKeyBySelector.delete(selector); |
+ filterKeyBySelector.delete(code); |
unconditionalSelectors = null; |
} |
knownExceptions.add(filter.text); |
} |
else |
{ |
if (keyByFilter.has(filter)) |
return; |
let key = filterByKey.push(filter) - 1; |
keyByFilter.set(filter, key); |
- if (!(filter.domains || exceptions.has(filter.selector))) |
+ if (!(filter.domains || exceptions.has(filter.code))) |
{ |
// The new filter's selector is unconditionally applied to all domains |
- filterKeyBySelector.set(filter.selector, key); |
+ filterKeyBySelector.set(filter.code, key); |
unconditionalSelectors = null; |
} |
else |
{ |
// The new filter's selector only applies to some domains |
this._addToFiltersByDomain(key, filter); |
} |
} |
FilterNotifier.emit("elemhideupdate"); |
}, |
_removeFilterKey(key, filter) |
{ |
- if (filterKeyBySelector.get(filter.selector) == key) |
+ if (filterKeyBySelector.get(filter.code) == key) |
{ |
- filterKeyBySelector.delete(filter.selector); |
+ filterKeyBySelector.delete(filter.code); |
unconditionalSelectors = null; |
return; |
} |
// We haven't found this filter in unconditional filters, look in |
// filtersByDomain. |
let domains = filter.domains || defaultDomains; |
for (let domain of domains.keys()) |
@@ -187,17 +187,17 @@ |
*/ |
remove(filter) |
{ |
if (filter instanceof ElemHideException) |
{ |
if (!knownExceptions.has(filter.text)) |
return; |
- let list = exceptions.get(filter.selector); |
+ let list = exceptions.get(filter.code); |
let index = list.indexOf(filter); |
if (index >= 0) |
list.splice(index, 1); |
knownExceptions.delete(filter.text); |
} |
else |
{ |
let key = keyByFilter.get(filter); |
@@ -216,17 +216,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]; |
} |
@@ -305,17 +305,17 @@ |
{ |
for (let [filterKey, filter] of filters) |
{ |
if (seenFilters.has(filterKey)) |
continue; |
seenFilters.add(filterKey); |
if (filter && !this.getException(filter, domain)) |
- selectors.push(filter.selector); |
+ selectors.push(filter.code); |
} |
} |
if (currentDomain == "") |
break; |
let nextDot = currentDomain.indexOf("."); |
currentDomain = nextDot == -1 ? "" : currentDomain.substr(nextDot + 1); |