Convert Figma logo to code with AI

gorhill logouBlock

uBlock Origin - An efficient blocker for Chromium and Firefox. Fast and lean.

46,727
3,123
46,727
14

Top Related Projects

Brave's Rust-based adblock engine

AdGuard browser extension

EasyList filter subscription (EasyList, EasyPrivacy, EasyList Cookie, Fanboy's Social/Annoyances/Notifications Blocking List)

Privacy Badger is a browser extension that automatically learns to block invisible trackers.

Quick Overview

uBlock Origin is a free and open-source, cross-platform browser extension for content filtering and ad blocking. It is designed to be lightweight and efficient, using less CPU and memory than other popular ad blockers while providing powerful customization options for advanced users.

Pros

  • Highly efficient, using fewer system resources compared to other ad blockers
  • Extensive filter lists and customization options for advanced users
  • Regular updates and active development
  • No "acceptable ads" program, blocking all ads by default

Cons

  • Steeper learning curve for advanced features compared to simpler ad blockers
  • May break functionality on some websites due to aggressive blocking
  • Less user-friendly interface for casual users
  • Not available on the Chrome Web Store (for Chrome users)

Getting Started

  1. Visit the uBlock Origin GitHub repository: https://github.com/gorhill/uBlock
  2. Choose the appropriate browser-specific installation link from the README
  3. Install the extension from your browser's extension store or by following the manual installation instructions
  4. After installation, click the uBlock Origin icon in your browser toolbar to access settings and customize as needed

Note: For Chrome users, you may need to install from the Firefox Add-ons store or manually load the extension, as it's not available on the Chrome Web Store.

Competitor Comparisons

Brave's Rust-based adblock engine

Pros of adblock-rust

  • Written in Rust, offering better performance and memory safety
  • Designed for cross-platform use, including mobile devices
  • Actively maintained by Brave Software, with regular updates

Cons of adblock-rust

  • Less extensive feature set compared to uBlock
  • Smaller community and fewer third-party filter lists
  • Limited customization options for end-users

Code Comparison

uBlock (JavaScript):

api.net.onBeforeRequest.addListener(
    onBeforeRequest,
    {
        urls: ['<all_urls>'],
        types: allNetRequestTypes
    },
    ['blocking']
);

adblock-rust (Rust):

pub fn check_network_urls(&self, url: &str, source_url: &str, request_type: &str) -> bool {
    self.engine.check_network_urls(url, source_url, request_type)
}

The code snippets show different approaches to handling network requests. uBlock uses JavaScript and browser APIs, while adblock-rust implements a Rust function for URL checking. The Rust implementation is likely more efficient but may be less flexible for browser-specific features.

AdGuard browser extension

Pros of AdguardBrowserExtension

  • More comprehensive filtering options, including HTTPS filtering and custom rules
  • Offers additional privacy features like tracking protection and social media blocking
  • Supports a wider range of browsers, including Safari and Edge

Cons of AdguardBrowserExtension

  • Larger codebase and potentially higher resource usage
  • Less frequent updates compared to uBlock
  • Some advanced features require a paid subscription

Code Comparison

uBlock (content-script.js):

const µb = µBlock;
const onBeforeScriptExecute = {
    actor: 'content',
    handler: function(details) {
        if ( µb.canInjectScripts() === false ) { return; }
        const fctxt = µb.filteringContext.duplicate();

AdguardBrowserExtension (content-script.js):

const adguard = window.adguard;
const contentPage = adguard.contentPage;
const requestFilter = adguard.requestFilter;
const filteringLog = adguard.filteringLog;
const safebrowsing = adguard.safebrowsing;

Both projects use content scripts for ad blocking, but AdguardBrowserExtension's code structure appears more modular with separate components for different functionalities. uBlock's code is more compact and focused on core ad-blocking features.

EasyList filter subscription (EasyList, EasyPrivacy, EasyList Cookie, Fanboy's Social/Annoyances/Notifications Blocking List)

Pros of EasyList

  • Focused solely on filter lists, providing a comprehensive set of rules for ad-blocking
  • Community-driven project with frequent updates and contributions
  • Can be used by various ad-blocking extensions and software

Cons of EasyList

  • Requires integration into other software to function as an ad-blocker
  • May include some false positives or overly aggressive rules
  • Limited customization options for end-users

Code Comparison

uBlock:

var µBlock = (function() {
    'use strict';
    var µb = {
        userSettings: {
            advancedUserEnabled: false,
            alwaysDetachLogger: false,
            autoUpdate: true,
            // ... more settings
        },
        // ... more code
    };
    return µb;
})();

EasyList:

! Example EasyList rules
||example.com/ads/*
##.ad-banner
@@||example.com/assets/images/*

Summary

uBlock is a full-featured ad-blocker with its own engine and UI, while EasyList is a collection of filter lists used by various ad-blocking tools. uBlock offers more customization and control for users, whereas EasyList focuses on maintaining comprehensive filter lists for blocking ads and trackers.

Privacy Badger is a browser extension that automatically learns to block invisible trackers.

Pros of Privacy Badger

  • Learns and adapts to trackers automatically without relying on predefined lists
  • Focuses specifically on privacy and tracking protection
  • Developed by the Electronic Frontier Foundation, a respected privacy advocacy organization

Cons of Privacy Badger

  • Less comprehensive ad-blocking capabilities compared to uBlock Origin
  • May require more system resources due to its learning algorithm
  • Limited customization options for advanced users

Code Comparison

Privacy Badger (JavaScript):

function updateOrigin(tabId, frameId, origin, action) {
  if (!origin) {
    return;
  }
  if (!(origin in tabData[tabId])) {
    tabData[tabId][origin] = {};
  }
  tabData[tabId][origin][frameId] = action;
}

uBlock Origin (JavaScript):

µBlock.staticNetFilteringEngine.matchString(
    fctxt,
    requestType,
    requestURL
).then(response => {
    if ( response === 0 ) {
        return;
    }
    // Block the request
});

Both projects use JavaScript for their core functionality, but uBlock Origin's code appears more focused on efficient filtering, while Privacy Badger's code emphasizes tracking and managing origin data.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Badge Commits Badge Issues Badge Localization Badge License Badge NPM Badge Mozilla Badge Chrome Badge Edge


uBlock Origin (uBO)

BEWARE! uBO is (and has always been) COMPLETELY UNRELATED to the website ublock.org.


Get uBlock Origin for Firefox Get uBlock Origin for Microsoft Edge Get uBlock Origin for Opera Get uBlock Origin for Thunderbird


Get uBlock Origin for Chromium
IMPORTANT: About Google Chrome's "This extension may soon no longer be supported"


uBlock Origin (uBO) is a CPU and memory-efficient wide-spectrum content blocker for Chromium and Firefox. It blocks ads, trackers, coin miners, popups, annoying anti-blockers, malware sites, etc., by default using EasyList, EasyPrivacy, Peter Lowe's Blocklist, Online Malicious URL Blocklist, and uBO filter lists. There are many other lists available to block even more. Hosts files are also supported. uBO uses the EasyList filter syntax and extends the syntax to work with custom rules and filters.

You may easily unselect any preselected filter lists if you think uBO blocks too much. For reference, Adblock Plus installs with only EasyList, ABP filters, and Acceptable Ads enabled by default.

It is important to note that using a blocker is NOT theft. Do not fall for this creepy idea. The ultimate logical consequence of blocking = theft is the criminalization of the inalienable right to privacy.

Ads, "unintrusive" or not, are just the visible portion of the privacy-invading means entering your browser when you visit most sites. uBO's primary goal is to help users neutralize these privacy-invading methods in a way that welcomes those users who do not wish to use more technical means.


Documentation

Basic Mode Advanced Mode
The simple popup user interface for an install-it-and-forget-it type of installation that is configured optimally by default. The advanced popup user interface includes a point-and-click firewall that is configurable on a per-site basis.

Visit the Wiki for documentation.

For support, questions, or help, visit /r/uBlockOrigin.

Installation

Required Permissions

Firefox

Firefox Add-ons

Development Builds

uBO works best on Firefox and is available for desktop and Android versions.

Thunderbird

Thunderbird Add-ons

In Thunderbird, uBlock Origin does not affect emails, just feeds.

Chromium

Chrome Web Store

Microsoft Edge Add-ons (Published by: Nicole Rolls)

Opera Add-ons

Development Builds

uBO should be compatible with any Chromium-based browser.

All Programs

Do NOT use uBO with any other content blocker. uBO performs as well as or better than most popular blockers. Other blockers can prevent uBO's privacy or anti-blocker-defusing features from working correctly.

Manual Installation

Enterprise Deployment

Deploying uBO

Release History

Releases Page

Translations

Help translate uBO via Crowdin.

About

Manifesto

Privacy Policy

GPLv3 License

Free. Open-source. For users by users. No donations sought.

If you ever want to contribute something, think about the people working hard to maintain the filter lists you are using, which are available to use by all for free.