DEV Community

Vinhdubaii
Vinhdubaii

Posted on

neat-filters: uBlock Origin filter lists rebuilt every 6 hours for adblock-rust (open source, looking for contributors)

 I’m building NEAT, a browser on WinUI 3 + WebView2, and I just open-sourced the two pieces behind its built-in content blocker.

neat-filters takes uBlock Origin’s upstream sources and republishes them in a form adblock-rust can use.

GitHub Actions rebuilds it every 6 hours. A release is only created if something actually changed.
It publishes uBO’s default lists, EasyList, EasyPrivacy, Peter Lowe’s list and URLhaus, plus a resources.json with uBO scriptlets, redirect resources and Brave’s extras.
Preprocessing resolves !#include / !#if, so the lists are flat and contain only rules.
It rewrites denyallow= (about 250 rules) into block rules plus exceptions, and moves about 3,100 $popup / $popunder rules into their own list.
Every build is loaded into a real adblock-rust engine with smoke tests. If a list shrinks by more than 30%, the run fails and the last good release stays up.
A small manifest.json carries sha256 hashes, so clients only download files that changed.

Still not supported, because adblock-rust can’t parse them: urlskip=, HTML filters (##^), $replace, ipaddress= and cname. That’s about 800 lines out of roughly 175,000 rules.

neat-adblock is a small C ABI DLL around adblock-rust, with a P/Invoke wrapper, that loads a neat-filters release. The Rust part is tested on Linux. The Windows builds and the C# files haven’t been run yet, so it’s early.

Where help would be useful:

Reviewing the filter transforms for edge cases
Handling more of the unsupported uBO syntax
Compiling and testing the C# wrapper and the Windows builds
Wiring it into WebView2 (main-frame vs iframe detection is the awkward part)

Repos:

https://github.com/neatbrowser/neat-filters
https://github.com/neatbrowser/neat-adblock

Feedback welcome, especially on the filter pipeline.

Top comments (0)