Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: lib/abp2blocklist.js

Issue 29426579: Noissue - Reimplement public suffix matching more efficiently (Closed) Base URL: https://hg.adblockplus.org/abp2blocklist
Patch Set: Created May 1, 2017, 6:48 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « README.md ('k') | lib/domain.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
{
« no previous file with comments | « README.md ('k') | lib/domain.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld