Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: lib/elemHideEmulation.js

Issue 29929561: Issue 7074 - Keep filter objects instead of text (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Created Oct. 28, 2018, 11:46 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | lib/snippets.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « no previous file | lib/snippets.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld