adblock-minus

    1.0.6 • Public • Published

    npm version Build Status js-standard-style Test Coverage dependencies Status devDependencies Status NSP Status

    A plain JavaScript implementation of adblocking that understands most Adblock Plus filters syntax.

    The package also contains a runnable Chrome extension demo, could be a good usage guide and starting point for your work.

    To run the demo:

    npm install && npm run build
    

    then load the build folder via Chrome extensions page.

    Or quick install via Chrome web store

    Install

    npm install --save adblock-minus

    Usage

    const adblock = require('adblock-minus')
    const blocker = new adblock.Blocker()
     
    const target = 'http://evil.com/ad.gif'
    blocker.match(target) // => false
    blocker.add('||evil.com/ad.')
    blocker.match(target) // => true
     
    blocker.add('evil.com###adbanner')
    for (const selector of blocker.selectors('evil.com')) {
      console.log(selector) // => ['#adbanner']
    }

    Install

    npm i adblock-minus

    DownloadsWeekly Downloads

    4

    Version

    1.0.6

    License

    GPL-3.0

    Last publish

    Collaborators

    • xiaody