• Stars
    star
    724
  • Rank 60,137 (Top 2 %)
  • Language
    TypeScript
  • License
    Mozilla Public Li...
  • Created over 6 years ago
  • Updated about 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Efficient embeddable adblocker library

Adblocker

Efficient · Minimal · JavaScript · TypeScript · uBlock Origin- and Easylist-compatible
Node.js · Puppeteer · Electron · WebExtension

Github Actions Build Status Github Actions Assets Status Blazing Fast npm version weekly downloads from npm
code style: prettier Follow Ghostery on Twitter Dependabot License Badge


Cliqz' adblocker is a JavaScript library for blocking ads, trackers, and annoyances with a strong focus on efficiency. It was designed with compatibility in mind and integrates seamlessly with the following environments:

Getting Started

Cliqz' adblocker is the easiest and most efficient way to block ads and trackers in your project. Only a few lines of code are required to integrate smoothly with Puppeteer, Electron, a Chrome- and Firefox-compatible browser extension, or any environment supporting JavaScript (e.g. Node.js or React Native).

Here is how to do it in two steps for a Chrome- and Firefox-compatible WebExtension:

  1. Install: npm install --save @cliqz/adblocker-webextension
  2. Add the following in your background script:
import { WebExtensionBlocker } from '@cliqz/adblocker-webextension';

WebExtensionBlocker.fromPrebuiltAdsAndTracking().then((blocker) => {
  blocker.enableBlockingInBrowser(browser);
});

Congratulations, you are now blocking all ads and trackers! 🎉

Compatibility

The library supports 99% of all filters from the Easylist and uBlock Origin projects. Check the compatibility matrix on the wiki for more details.

Contributing

This project makes use of lerna and yarn workspaces under the hood. Quickly get started with:

  1. Fork and clone the repository,
  2. Install dependencies: yarn bootstrap,
  3. Build: yarn watch,
  4. Test: yarn test,
  5. Bundle: yarn bundle.

For any question, feel free to open an issue or a pull request to get some help!

Who is using it?

This library is the building block technology used to power the adblockers from Ghostery and Cliqz on both desktop and mobile platforms. It is already running in production for millions of users and has been battle-tested to satisfy the following use-cases:

  • Mobile-friendly adblocker in react-native, WebExtension, or custom JavaScript context: Ghostery and Cliqz.
  • Ads and trackers blocker in Electron applications, Puppeteer headless browsers, Cliqz browser, WebExtensions (cliqz, ghostery and standalone).
  • Batch requests processing in Node.js, HTML fuzzy keywork matcher, and more.

The innovative algorithms and architecture designed and implemented in this project have been shown to be among the most efficient ways to implement ad-blockers and have been used in other projects to implement highly performant adblockers such as Brave.

Swag

Show the world you're using ghostery/adblockerpowered by Ghostery

[![powered by Ghostery](https://img.shields.io/badge/ghostery-powered-blue?logo=ghostery)](https://github.com/ghostery/adblocker)

Or HTML:

<a href="https://github.com/ghostery/adblocker/" target="_blank" rel="noopener noreferrer">
    <img alt="powered by Ghostery" src="https://img.shields.io/badge/ghostery-powered-blue?logo=ghostery">
</a>

License

Mozilla Public License 2.0

More Repositories

1

ghostery-extension

Ghostery Browser Extension for Firefox, Chrome, Opera, Edge and Safari
JavaScript
1,299
star
2

local-sheriff

Think of Local sheriff as a recon tool in your browser (WebExtension). While you normally browse the internet, Local Sheriff works in the background to empower you in identifying what data points (PII) are being shared / leaked to which all third-parties.
JavaScript
303
star
3

banshee

An iOS browser built on top of UIWebView
Objective-C
127
star
4

user-agent-desktop

Ghostery Desktop Browser
JavaScript
102
star
5

user-agent-ios

Ghostery iOS Browser
Swift
67
star
6

trackerdb

Ghostery Tracker Database
JavaScript
45
star
7

areweprivateyet

The crawler/analysis component of Are We Private Yet?
Java
43
star
8

GhosterySafari

Ghostery Lite app extension for Safari desktop browser
Swift
35
star
9

user-agent-android

Ghostery Android Browser
Shell
34
star
10

browser-android

Legacy Ghostery Browser for Android
24
star
11

url-parser

A fast typescript implementation of the window.URL API
TypeScript
24
star
12

autoconsent

TypeScript
21
star
13

browser-ios

Legacy Ghostery Browser for iOS
Swift
20
star
14

addon-simple-storage-editor

Firefox Add-on SDK simple storage viewer and editor
JavaScript
13
star
15

ghostery-dnr-extension

Swift
12
star
16

ghostery-browser-linux-support

Ghostery Browser on Linux (installer and Linux-specific documentation)
Ruby
8
star
17

common

Shared JS modules for Ghostery projects
JavaScript
7
star
18

ghostery-search-extension

JavaScript
6
star
19

broken-page-reports

TypeScript
6
star
20

ghostery-dawn-onboarding-extension

CSS
3
star
21

ghostery-newtab-extension

JavaScript
3
star
22

ghostery-tracker-analytics-extension

JavaScript
2
star
23

urlfilter2dnr

JavaScript
1
star
24

benchmarks

JavaScript
1
star
25

.github

1
star