Index: lib/filterClasses.js |
=================================================================== |
--- a/lib/filterClasses.js |
+++ b/lib/filterClasses.js |
@@ -543,17 +543,20 @@ |
if (!domains) |
return true; |
// If the document has no host name, match only if the filter |
// isn't restricted to specific domains |
if (!docDomain) |
return domains.get(""); |
- docDomain = docDomain.replace(/\.+$/, "").toLowerCase(); |
+ if (docDomain[docDomain.length - 1] == ".") |
+ docDomain = docDomain.replace(/\.+$/, ""); |
+ |
+ docDomain = docDomain.toLowerCase(); |
while (true) |
{ |
let isDomainIncluded = domains.get(docDomain); |
if (typeof isDomainIncluded != "undefined") |
return isDomainIncluded; |
let nextDot = docDomain.indexOf("."); |
@@ -571,17 +574,20 @@ |
*/ |
isActiveOnlyOnDomain(docDomain) |
{ |
let {domains} = this; |
if (!docDomain || !domains || domains.get("")) |
return false; |
- docDomain = docDomain.replace(/\.+$/, "").toLowerCase(); |
+ if (docDomain[docDomain.length - 1] == ".") |
+ docDomain = docDomain.replace(/\.+$/, ""); |
+ |
+ docDomain = docDomain.toLowerCase(); |
for (let [domain, isIncluded] of domains) |
{ |
if (isIncluded && domain != docDomain) |
{ |
if (domain.length <= docDomain.length) |
return false; |