Coder Social home page Coder Social logo

rakhithjk / abp2blocklist Goto Github PK

View Code? Open in Web Editor NEW

This project forked from adblockplus/abp2blocklist

0.0 1.0 0.0 2.82 MB

Code to convert Adblock Plus filter lists to WebKit content blocker lists

License: GNU General Public License v3.0

JavaScript 100.00%

abp2blocklist's Introduction

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

Usage

Create a WebKit block list output.json from the Adblock Plus filter list input.txt:

node abp2blocklist.js < input.txt > output.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

Adblock Plus core code

To parse the Adblock Plus filters, we reuse parts of the core Adblock Plus code, those files are inside the adblockpluscore directory.

If you need to refresh those files, run these commands (adjusting the paths as appropriate):

cp adblockpluscore/lib/common.js abp2blocklist/adblockpluscore/lib/
cp adblockpluscore/lib/coreUtils.js abp2blocklist/adblockpluscore/lib/
cp adblockpluscore/lib/domain.js abp2blocklist/adblockpluscore/lib/
cp adblockpluscore/data/resources.json abp2blocklist/adblockpluscore/data/
cp adblockpluscore/data/publicSuffixList.json abp2blocklist/adblockpluscore/data/
grep -vi filterNotifier adblockpluscore/lib/filterClasses.js > abp2blocklist/adblockpluscore/lib/filterClasses.js

abp2blocklist's People

Contributors

dandelionsprout avatar fhd avatar kzar avatar snoack avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.