Index: lib/elemHideEmulation.js |
=================================================================== |
--- a/lib/elemHideEmulation.js |
+++ b/lib/elemHideEmulation.js |
@@ -17,17 +17,16 @@ |
"use strict"; |
/** |
* @fileOverview Element hiding emulation implementation. |
*/ |
const {ElemHideExceptions} = require("./elemHideExceptions"); |
-const {Filter} = require("./filterClasses"); |
let filters = new Set(); |
/** |
* Container for element hiding emulation filters |
* @class |
*/ |
let ElemHideEmulation = { |
@@ -40,39 +39,38 @@ |
}, |
/** |
* Add a new element hiding emulation filter |
* @param {ElemHideEmulationFilter} filter |
*/ |
add(filter) |
{ |
- filters.add(filter.text); |
+ filters.add(filter); |
}, |
/** |
* Removes an element hiding emulation filter |
* @param {ElemHideEmulationFilter} filter |
*/ |
remove(filter) |
{ |
- filters.delete(filter.text); |
+ filters.delete(filter); |
}, |
/** |
* Returns a list of all rules active on a particular domain |
* @param {string} domain |
* @return {ElemHideEmulationFilter[]} |
*/ |
getRulesForDomain(domain) |
{ |
let result = []; |
- for (let text of filters.values()) |
+ for (let filter of filters) |
{ |
- let filter = Filter.fromText(text); |
if (filter.isActiveOnDomain(domain) && |
!ElemHideExceptions.getException(filter.selector, domain)) |
{ |
result.push(filter); |
} |
} |
return result; |
} |