Code to convert Adblock Plus filter lists to WebKit content blocker lists
JavaScript
Latest commit 858f371 Aug 24, 2016 @kzar kzar Noissue - Add punycode dependency explicitly
Since the built-in punycode will be depreciated[1] as of Node.js v7
we need to start declaring this dependency explicitly.

[1] - nodejs/node#7941
Permalink
Failed to load latest commit information.
lib
node_modules
test
.gitignore
.hgignore
LICENSE.txt Licensed the code under the GPLv3 Oct 5, 2015
README.md
abp2blocklist.js
package.json

README.md

abp2blocklist

This is a script to convert Adblock Plus filter lists to WebKit block lists.

Note that WebKit content blockers are fairly limited. Hence, not all filters can be converted (in a compatible way), and some differences compared to Adblock Plus for other browsers are expected.

This script is used to convert the filter lists for Adblock Plus for iOS.

Requirements

The required packages can be installed via NPM:

npm install

filterClasses.js

The filterClasses module in node_modules/filterClasses.js is generated from the module in the adblockpluscore repository. It has been generated using JS Hydra, and small modifications made. If you need to re-generate the file run this command (adjusting the paths as appropriate):

python buildtools/jshydra/abp_rewrite.py adblockpluscore/lib/filterClasses.js | grep -vi filterNotifier > ../abp2blocklist/node_modules/filterClasses.js

You will then need to remove any references to the utils module from the generated file by hand.

Usage

node abp2blocklist.js < easylist.txt > easylist.json

Tests

Unit tests live in the tests/ directory. To run the unit tests ensure you have already installed the required packages (see above) and then type this command:

npm test