| Index: lib/filterClasses.js |
| =================================================================== |
| --- a/lib/filterClasses.js |
| +++ b/lib/filterClasses.js |
| @@ -381,23 +381,16 @@ |
| /** |
| * Separator character used in domainSource property, must be |
| * overridden by subclasses |
| * @type {string} |
| */ |
| domainSeparator: null, |
| /** |
| - * Determines whether the trailing dot in domain names isn't important and |
| - * should be ignored, must be overridden by subclasses. |
| - * @type {boolean} |
| - */ |
| - ignoreTrailingDot: true, |
| - |
| - /** |
| * Determines whether domainSource is already upper-case, |
| * can be overridden by subclasses. |
| * @type {boolean} |
| */ |
| domainSourceIsUpperCase: false, |
| /** |
| * Map containing domains that this filter should match on/not match |
| @@ -421,28 +414,24 @@ |
| { |
| // 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 |
| - if (this.ignoreTrailingDot) |
| - list[0] = list[0].replace(/\.+$/, ""); |
| domains = new Map([["", false], [list[0], true]]); |
| } |
| else |
| { |
| let hasIncludes = false; |
| for (let i = 0; i < list.length; i++) |
| { |
| let domain = list[i]; |
| - if (this.ignoreTrailingDot) |
| - domain = domain.replace(/\.+$/, ""); |
| if (domain == "") |
| continue; |
| let include; |
| if (domain[0] == "~") |
| { |
| include = false; |
| domain = domain.substr(1); |
| @@ -496,19 +485,17 @@ |
| if (!this.domains) |
| return true; |
| // If the document has no host name, match only if the filter |
| // isn't restricted to specific domains |
| if (!docDomain) |
| return this.domains.get(""); |
| - if (this.ignoreTrailingDot) |
| - docDomain = docDomain.replace(/\.+$/, ""); |
| - docDomain = docDomain.toUpperCase(); |
| + docDomain = docDomain.replace(/\.+$/, "").toUpperCase(); |
| while (true) |
| { |
| let isDomainIncluded = this.domains.get(docDomain); |
| if (typeof isDomainIncluded != "undefined") |
| return isDomainIncluded; |
| let nextDot = docDomain.indexOf("."); |
| @@ -524,19 +511,17 @@ |
| * @param {string} docDomain |
| * @return {boolean} |
| */ |
| isActiveOnlyOnDomain(docDomain) |
| { |
| if (!docDomain || !this.domains || this.domains.get("")) |
| return false; |
| - if (this.ignoreTrailingDot) |
| - docDomain = docDomain.replace(/\.+$/, ""); |
| - docDomain = docDomain.toUpperCase(); |
| + docDomain = docDomain.replace(/\.+$/, "").toUpperCase(); |
| for (let [domain, isIncluded] of this.domains) |
| { |
| if (isIncluded && domain != docDomain) |
| { |
| if (domain.length <= docDomain.length) |
| return false; |
| @@ -1010,21 +995,16 @@ |
| ElemHideBase.prototype = extend(ActiveFilter, { |
| /** |
| * @see ActiveFilter.domainSeparator |
| */ |
| domainSeparator: ",", |
| /** |
| - * @see ActiveFilter.ignoreTrailingDot |
| - */ |
| - ignoreTrailingDot: false, |
| - |
| - /** |
| * Host names or domains the filter should be restricted to (can be null for |
| * no restriction) |
| * @type {?string} |
| */ |
| selectorDomains: null, |
| /** |
| * CSS selector for the HTML elements that should be hidden |
| * @type {string} |