Index: lib/filterClasses.js |
=================================================================== |
--- a/lib/filterClasses.js |
+++ b/lib/filterClasses.js |
@@ -909,17 +909,17 @@ ElemHideBase.fromText = function(text, d |
// Note: The ElemHide.prototype.domainSeparator is duplicated here, if that |
// changes this must be changed too. |
if (domain && /(^|,)~?(,|$)/.test(domain)) |
return new InvalidFilter(text, "filter_invalid_domain"); |
if (isException) |
return new ElemHideException(text, domain, selector); |
- if (selector.indexOf("[-abp-properties") != -1) |
+ if ((selector.indexOf("[-abp-properties") != -1) || (selector.indexOf(":has(") != -1)) |
{ |
// Element hiding emulation filters are inefficient so we need to make sure |
// that they're only applied if they specify active domains |
if (!/,[^~][^,.]*\.[^,]/.test("," + domain)) |
return new InvalidFilter(text, "filter_elemhideemulation_nodomain"); |
return new ElemHideEmulationFilter(text, domain, selector); |
} |
@@ -969,14 +969,18 @@ ElemHideException.prototype = extend(Ele |
* @param {String} domains see ElemHideBase() |
* @param {String} selector see ElemHideBase() |
* @constructor |
* @augments ElemHideBase |
*/ |
function ElemHideEmulationFilter(text, domains, selector) |
{ |
ElemHideBase.call(this, text, domains, selector); |
+ this.cssPropFilter = (selector.indexOf("[-abp-properties") != -1); |
+ this.pseudoClassHas = (selector.indexOf(":has(") != -1); |
} |
exports.ElemHideEmulationFilter = ElemHideEmulationFilter; |
ElemHideEmulationFilter.prototype = extend(ElemHideBase, { |
- type: "elemhideemulation" |
+ type: "elemhideemulation", |
+ cssPropFilter: false, |
+ pseudoClassHas: false, |
}); |