Index: lib/abp2blocklist.js |
=================================================================== |
--- a/lib/abp2blocklist.js |
+++ b/lib/abp2blocklist.js |
@@ -15,19 +15,20 @@ |
* along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. |
*/ |
/** @module abp2blocklist */ |
"use strict"; |
let filterClasses = require("filterClasses"); |
-let tldjs = require("tldjs"); |
let punycode = require("punycode"); |
+let {getBaseDomain} = require("./domain"); |
+ |
const selectorLimit = 5000; |
const typeMap = filterClasses.RegExpFilter.typeMap; |
const whitelistableRequestTypes = (typeMap.IMAGE |
| typeMap.STYLESHEET |
| typeMap.SCRIPT |
| typeMap.FONT |
| typeMap.MEDIA |
| typeMap.POPUP |
@@ -218,17 +219,17 @@ |
function addDomainPrefix(domains) |
{ |
let result = []; |
for (let domain of domains) |
{ |
result.push(domain); |
- if (tldjs.getDomain(domain) == domain) |
+ if (getBaseDomain(domain) == domain) |
result.push("www." + domain); |
} |
return result; |
} |
function convertFilterAddRules(rules, filter, action, withResourceTypes) |
{ |