展示HN:Adblock-rust Manager – Firefox扩展,用于启用Brave广告拦截器
Show HN: Adblock-rust Manager – Firefox extension to enable the Brave ad blocker

原始链接: https://github.com/electricant/adblock-rust-manager

## Adblock Rust Manager 摘要 Adblock Rust Manager 是一个 Firefox 扩展,旨在轻松启用和管理 Firefox 内置的、基于 Rust 的广告和追踪拦截引擎 – `adblock-rust` – 该引擎在 Firefox 149 中悄然添加。虽然 Mozilla 默认禁用它且没有用户界面,但此扩展提供了激活和配置它的用户友好方式。 该扩展提供一键切换 Firefox 的增强型追踪保护 (ETP) 功能,并为必要的 `about:config` 首选项提供引导式设置(由于 WebExtension 的限制,无法自动设置)。它包含一个过滤器列表管理器,预设选项包括 EasyList 和 uBO 过滤器,允许用户自定义其拦截体验。 安装需要临时附加组件、允许未签名扩展的永久安装(但可能安全性较低),或从源代码构建。安装后,用户按照简单的步骤通过 `about:config` 启用引擎并配置过滤器列表,并由扩展的复制粘贴功能提供指导。最终结果是一个强大的、开源的广告拦截解决方案,直接在 Firefox 中利用 Brave 的技术。

对不起。
相关文章

原文

A Firefox extension that enables and manages Firefox's built-in adblock-rust engine — Brave's open-source, Rust-based ad and tracker blocking engine, quietly shipped in Firefox 149.

Firefox Manifest License

In March 2026, Firefox 149 silently shipped adblock-rust — the same Rust-based content blocking engine that powers Brave's native ad blocker. It supports network request blocking, cosmetic filtering, and is fully compatible with uBlock Origin filter list syntax.

Mozilla shipped it disabled by default, with no user interface and no mention in the release notes. It is controlled exclusively by two about:config preferences:

Preference Purpose
privacy.trackingprotection.content.protection.enabled Enables/disables the engine
privacy.trackingprotection.content.protection.test_list_urls Pipe-separated list of filter list URLs

This extension gives you a proper UI to manage both.

  • 🛡 One-click ETP toggle — Disable Firefox's built-in Enhanced Tracking Protection so adblock-rust handles blocking instead. Applied instantly via the standard WebExtension Privacy API.
  • 📋 Guided setup — Step-by-step instructions for the about:config prefs that can't be set programmatically, with one-click copy buttons for every value you need to paste.
  • 📝 Filter list manager — Add, remove, and reorder filter lists. Builds the pipe-separated value for you automatically.
  • 8 preset lists — Quick-add popular lists including EasyList, EasyPrivacy, uBO Filters, AdGuard, and more.
  • 💾 Persistent state — Your lists and settings survive browser restarts.
  • Progress tracking — Mark each setup step as done to keep track of what's been applied.

Why can't the extension set the prefs automatically?

Standard WebExtensions cannot write arbitrary about:config preferences. That requires a Mozilla-signed privileged add-on — something only possible through Mozilla's internal signing pipeline.

The browser.privacy API covers ETP (Enhanced Tracking Protection) and that toggle works instantly. But the two adblock-rust prefs have no equivalent WebExtension API, so the extension guides you through a one-time ~30 second manual setup instead.

  • Firefox 149 or later (where adblock-rust is bundled)
  • Windows, macOS, or Linux

Option A — Temporary add-on (recommended for testing)

Temporary add-ons are the easiest way to try the extension. They are removed when Firefox restarts.

  1. Download the latest adblock-rust-manager.xpi from Releases
  2. Open Firefox and navigate to about:debugging
  3. Click "This Firefox" in the left sidebar
  4. Click "Load Temporary Add-on…"
  5. Select the downloaded .xpi file
  6. The purple shield icon appears in your toolbar

Option B — Permanent installation (unsigned)

For a permanent install that survives restarts, Firefox needs to allow unsigned extensions first.

  1. Go to about:config in Firefox
  2. Search for xpinstall.signatures.required and set it to false
  3. Go to about:addons
  4. Click the gear icon ⚙️ → "Install Add-on From File…"
  5. Select the .xpi file

⚠️ Setting xpinstall.signatures.required to false allows any unsigned extension to be installed. Only install extensions you trust.

Option C — Build from source

git clone https://github.com/your-username/adblock-rust-manager
cd adblock-rust-manager
zip -r adblock-rust-manager.xpi . -x "*.DS_Store" -x "*.git*" -x "README.md"

Then follow Option A or B above using the generated .xpi.

Once the extension is installed, click the purple shield icon in the Firefox toolbar to open the popup.

Step 0 — Disable ETP (optional but recommended)

Toggle "Disable Enhanced Tracking Protection" at the top of the popup. This turns off Firefox's built-in ETP globally so adblock-rust handles all blocking. The change is instant — no about:config needed.

If you prefer ETP to remain active on most sites, leave this off and only disable it for specific sites via the shield icon in the address bar.

Step 1 — Enable the adblock-rust engine

  1. Click "Copy pref name" in the Step 1 section — the pref name is now in your clipboard
  2. Open a new Firefox tab and type about:config in the address bar, then press Enter
  3. Accept the warning if prompted
  4. Paste the pref name into the search bar: privacy.trackingprotection.content.protection.enabled
  5. Click the toggle button on the right to set it to true
  6. Back in the extension popup, click "Mark done ✓"

Step 2 — Set your filter lists

  1. In the extension popup, add or remove filter lists using the list manager. The four default lists are pre-loaded:
    • EasyList — core ad blocking
    • EasyPrivacy — tracker blocking
    • Fanboy Cookie Monster — cookie banners
    • uBO Annoyances — other annoyances
  2. Click "Copy URL list value" — the combined pipe-separated value is now in your clipboard
  3. Go back to about:config and search for: privacy.trackingprotection.content.protection.test_list_urls
  4. Click the pencil ✏️ icon to edit the preference
  5. Paste the copied value and click the checkmark ✓ to save
  6. Back in the popup, click "Mark done ✓"

That's it. adblock-rust is now active with your chosen filter lists.

Additional lists available via the Quick-add chips in the popup:

  • uBO Filters
  • Peter Lowe's Ad & Tracking Server List
  • AdGuard Base Filters
  • AdGuard Tracking Protection
  1. In the extension popup, make sure ETP is disabled for the site you're testing (or use the shield icon in the address bar to disable it per-site)
  2. Visit a site with known ads such as yahoo.com
  3. Ad slots will still render in the page layout, but the actual ad content will be blocked — you'll see empty boxes or "Advertisement" placeholders instead of real ads
adblock-rust-manager/
├── manifest.json          # MV3 manifest — action, privacy, storage, tabs permissions
├── background.js          # Seeds default storage on first install
├── popup/
│   ├── popup.html         # Extension popup UI
│   ├── popup.js           # All UI logic + browser.privacy API calls
│   └── popup.css          # Styles (supports light & dark mode)
└── icons/
    ├── icon16.png
    ├── icon32.png
    ├── icon48.png
    └── icon96.png

An earlier version of this extension used Firefox's experiment_apis mechanism to write about:config prefs directly. This was removed because experiment_apis only works on Firefox Nightly and Developer Edition — it cannot be used in Release Firefox without a Mozilla-signed privileged add-on, regardless of about:config flags.

The current approach uses only standard MV3 WebExtension APIs and requires no special Firefox configuration beyond the one-time about:config setup described above.

Permission Why it's needed
privacy Controls ETP via browser.privacy.websites.trackingProtectionMode
storage Persists filter lists and toggle states across sessions
clipboardWrite Copies pref names and URL list values to your clipboard

MPL-2.0 — the same license as adblock-rust itself.

联系我们 contact @ memedata.com