Index: lib/filterClasses.js |
=================================================================== |
--- a/lib/filterClasses.js |
+++ b/lib/filterClasses.js |
@@ -80,17 +80,17 @@ |
* @type Object |
*/ |
Filter.knownFilters = Object.create(null); |
/** |
* Regular expression that element hiding filters should match |
* @type RegExp |
*/ |
-Filter.elemhideRegExp = /^([^\/\*\|\@"!]*?)#(\@)?(?:([\w\-]+|\*)((?:\([\w\-]+(?:[$^*]?=[^\(\)"]*)?\))*)|#([^{}]+))$/; |
+Filter.elemhideRegExp = /^([^\/\*\|\@"!]*?)#(\@)?(?:([\w\-]+|\*)((?:\([\w\-]+(?:[$^*]?=[^\(\)"]*)?\))*)|#(.+))$/; |
/** |
* Regular expression that RegExp filters specified as RegExps should match |
* @type RegExp |
*/ |
Filter.regexpRegExp = /^(@@)?\/.*\/(?:\$~?[\w\-]+(?:=[^,\s]+)?(?:,~?[\w\-]+(?:=[^,\s]+)?)*)?$/; |
/** |
* Regular expression that options on a RegExp filter should match |
* @type RegExp |
@@ -821,17 +821,19 @@ |
* @augments ActiveFilter |
*/ |
function ElemHideBase(text, domains, selector) |
{ |
ActiveFilter.call(this, text, domains || null); |
if (domains) |
this.selectorDomain = domains.replace(/,~[^,]+/g, "").replace(/^~[^,]+,?/, "").toLowerCase(); |
- this.selector = selector; |
+ |
+ // Braces are being escaped to prevent CSS rule injection. |
+ this.selector = selector.replace("{", "\\x7B").replace("}", "\\x7D"); |
Wladimir Palant
2016/12/13 14:32:16
I was probably not clear enough but the space at t
Felix Dahlke
2016/12/13 16:04:48
Done. I gotta admit this is feeling hacky. But I t
Wladimir Palant
2016/12/13 16:29:12
This is exactly how EHH is doing it - took a while
|
} |
exports.ElemHideBase = ElemHideBase; |
ElemHideBase.prototype = extend(ActiveFilter, { |
/** |
* @see ActiveFilter.domainSeparator |
*/ |
domainSeparator: ",", |