Index: lib/filterValidation.js |
=================================================================== |
--- a/lib/filterValidation.js |
+++ b/lib/filterValidation.js |
@@ -14,17 +14,17 @@ |
* You should have received a copy of the GNU General Public License |
* along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. |
*/ |
/** @module filterValidation */ |
"use strict"; |
-const {Filter, InvalidFilter, ElemHideBase} = require("filterClasses"); |
+const {Filter, InvalidFilter, ElemHideBase, ElemHideEmulationFilter} = require("filterClasses"); |
kzar
2017/05/29 15:25:57
Nit: This line is now too long. (Did you check for
|
const {Utils} = require("utils"); |
/** |
* An error returned by |
* {@link module:filterValidation.parseFilter parseFilter()} or |
* {@link module:filterValidation.parseFilters parseFilters()} |
* indicating that a given filter cannot be parsed, |
* contains an invalid CSS selector or is a filter list header. |
@@ -137,17 +137,19 @@ |
filter = Filter.fromText(text); |
if (filter instanceof InvalidFilter) |
{ |
return {error: new FilterParsingError("invalid-filter", |
{reason: filter.reason})}; |
} |
- if (filter instanceof ElemHideBase && !isValidCSSSelector(filter.selector)) |
+ if (filter instanceof ElemHideBase && |
+ !filter instanceof ElemHideEmulationFilter && |
+ !isValidCSSSelector(filter.selector)) |
{ |
return {error: new FilterParsingError("invalid-css-selector", |
{selector: filter.selector})}; |
} |
} |
return {filter}; |
}; |