| Index: lib/filterClasses.js |
| =================================================================== |
| --- a/lib/filterClasses.js |
| +++ b/lib/filterClasses.js |
| @@ -307,17 +307,22 @@ ActiveFilter.prototype = |
| * @type Object |
| */ |
| get domains() |
| { |
| let domains = null; |
| if (this.domainSource) |
| { |
| - let list = this.domainSource.split(this.domainSeparator); |
| + let source = this.domainSource; |
| + if (!(this instanceof RegExpFilter)) { |
|
Wladimir Palant
2014/04/10 18:43:38
I'd rather not hardcode the RegExpFilter class her
|
| + // RegExpFilter already have uppercase domains |
| + source = source.toUpperCase(); |
| + } |
| + let list = source.split(this.domainSeparator); |
| if (list.length == 1 && list[0][0] != "~") |
| { |
| // Fast track for the common one-domain scenario |
| domains = {__proto__: null, "": false}; |
| if (this.ignoreTrailingDot) |
| list[0] = list[0].replace(/\.+$/, ""); |
| domains[list[0]] = true; |
| } |
| @@ -347,17 +352,17 @@ ActiveFilter.prototype = |
| if (!domains) |
| domains = {__proto__: null}; |
| domains[domain] = include; |
| } |
| domains[""] = !hasIncludes; |
| } |
| - delete this.domainSource; |
| + this.domainSource = null; |
| } |
| this.__defineGetter__("domains", function() domains); |
| return this.domains; |
| }, |
| /** |
| * Checks whether this filter is active on a domain. |
| @@ -740,17 +745,17 @@ WhitelistFilter.prototype = |
| * @param {String} text see Filter() |
| * @param {String} domains (optional) Host names or domains the filter should be restricted to |
| * @param {String} selector CSS selector for the HTML elements that should be hidden |
| * @constructor |
| * @augments ActiveFilter |
| */ |
| function ElemHideBase(text, domains, selector) |
| { |
| - ActiveFilter.call(this, text, domains ? domains.toUpperCase() : null); |
| + ActiveFilter.call(this, text, domains || null); |
| if (domains) |
| this.selectorDomain = domains.replace(/,~[^,]+/g, "").replace(/^~[^,]+,?/, "").toLowerCase(); |
| this.selector = selector; |
| } |
| exports.ElemHideBase = ElemHideBase; |
| ElemHideBase.prototype = |