What does HackerNews think of adblock-rust?

Brave's Rust-based adblock engine

Language: Rust

There is a solution for Chromium based browsers:

https://github.com/brave/adblock-rust

but you will only have it built-in in Brave currently.

- Brave blocks you more against Fingerprinting than Firefox with uBlock. https://coveryourtracks.eff.org/

- Brave uses Chromium and uses better isolation and sandbox than Firefox. Especially on Android.

- Brave has Adblock built-in natively. It's written in Rust, so Manifest v3 will not affect it. https://github.com/brave/adblock-rust

- Brave is profitable on itself and not dependent on search engines money like Firefox.

Not saying it's the best but I decided against Firefox because the technical and financial foundation looks better on Brave for me.

MV2 should be supported even after the shutoff. As far as ad blocking is concerned, the built-in ad blocker doesn't depend on MV2.

https://github.com/brave/brave-browser/issues/20059

https://github.com/brave/adblock-rust

Brave's adblocker is internal and written in Rust.

https://github.com/brave/adblock-rust

I'm pretty sure it's also faster than any adblock extension like uBlock.

Switch to Brave, you will still maintain 99% of the bell and whistles of Chrome (because it's a Chrome fork) and you will have an Adblock engine directly in the browser core written in Rust. How cool is that...

Especially on mobile Brave is a game changer.

https://github.com/brave/adblock-rust

The syntax makes me wonder if the implementation is related to their high-performance filter rule evaluation library, adblock-rust [0]. Whatever is doing the dynamic reranking would need to evaluate lots of rules and churn through links fast.

[0] https://github.com/brave/adblock-rust

A rebuttal of the points in the article, as most of it is arguing in bad faith:

> Brave's adblocker is uBlock origin

It's not[1].

> Brave Today can't be disabled

Currently called "Brave News" if you're looking for it. And of course it actually can be disabled[2].

> Rewards is used to track you

A request being made to a URL does not mean you are being "tracked". Brave ads are the most privacy-preserving ad architecture[3] I know about, and they are the only people trying to make a better funding model for the web that still has a lot of the upsides of ad-driven content (mainly that it is not a regressive funding model). FF is worse in this regard because Mozilla gets most of their revenue from adtech giants that clearly don't give a flying fuck about your privacy. If you think Mozilla's funding model isn't a conflict of interest and makes the web more privacy-conscious, I have a bridge to sell you.

> Telemetry automatically violates your privacy

Not really? Of course, someone very concerned with privacy should opt out of telemetry, and Brave lets you do that.

> Auto-updates violate privacy

How so? As I point out later, the most likely result of auto-updates is that they help preserve your privacy by getting bugs patched faster.

> Affiliate codes

Yes, Brave had pre-programmed history items that were affiliate links to a crypto exchange. This harmed nobody in any way and the backlash was over-the-top. But they disabled in response to user feedback. I kinda liked this idea, as it is another way Brave was trying to fund themselves without being beholden to the Googlopoly which is an endeavor I very much support (with the caveat that it can't hurt users, which again this did not).

> Uphold doesn't care about your privacy

Uphold is a financial institution based in the US (as Brave is) which by necessity needs to comply with KYC/AML regulations. That means they need to collect your personal info. Take it up with the US government if you're unhappy.

> Tor tabs leaking DNS

Was fixed fairly quickly[4] and I think worth pointing out that no other browser even bothers trying to do something like this (integrating Tor for better privacy). Conveniently left out of the part where the author made the claim that "Brave isn't better for privacy than FF because it's just uBlock origin". Clearly brave is trying things that are not just adblocking to increase user privacy.

In general with this point, kinda funny that apparently the author of this article wants Brave to be the only software engineering org in existence that never has bugs. I guess if that's your stance though it makes sense that you wouldn't want auto-updates. For everyone else that lives in reality, auto-updates are a good thing for security (and therefore privacy, as made clear here when a privacy-related bug inevitably happens).

> Chromium and Google’s monopoly

Yeahhhhh, using FF isn't the silver bullet you think it is, as again, Mozilla gets the vast majority of their revenue from being paid by Google. What happens if that dries up? Seems unlikely that maintaining Blink without Mozilla will be easier than Brave maintaining a privacy-centric fork of Chromium (which will presumably continue to get not-privacy-related upstream improvements from Google/Microsoft/etc in perpetuity).

> brave-core-ext.s3.brave.com fetches 5 extensions and installs them. It is said that this might be a backdoor. But I don’t want to get conspiracist. I prefer giving you verifiable facts. I’ll limit myself to inform you about suspicious activities.

This is worse than all the Bitcoin maximalists / shitcoin pump-and-dumpers with their "this is not financial advice" shtick. We know what you're doing, it's pretty transparent. Especially when you do it twice:

> They were also accused of theft with BAT but this isn’t verifiable so I’ll only link the source for you.

In summary, I disagree with basically all of this article, significant parts of which are just factually wrong.

[1] https://github.com/brave/adblock-rust

[2] https://support.brave.com/hc/en-us/articles/360056341952-How...

[3] https://brave.com/intro-to-brave-ads/

[4] https://github.com/brave/brave-browser/issues/13527

> Their adblocker is just a fork of uBlock Origin,

This does not appear to be true. Here is the github repo for their open source adblock engine written in rust:

https://github.com/brave/adblock-rust

Here is a (somewhat dated) article describing it by the authors:

https://brave.com/improved-ad-blocker-performance/

> Google will take decisions that benefit their advertisement business, like making impossible to use adblockers on any Chromium based browser.

Because the brave adblocker is integrated directly into the browser (ie. not an extension) the Manifest V3 limitations don't apply.

I doubt Brave will do anything about it, because ad blocking in Brave is built-in and implemented without the extension APIs.

https://github.com/brave/adblock-rust

Chrome+uBO isnt necessarily the better option, as far as raw performance.

https://brave.com/improved-ad-blocker-performance/

https://github.com/brave/adblock-rust

Using Chrome+uBO+uMatrix and Brave side by side, Brave just works better. Less knobs to fiddle with, sane defaults. Sure I love the power of uMatrix, but it comes with its own time sink managing it. Brave, out of the box, performs correctly in most situations, and switching from default to blocking all cookies, javascript, and fingerprinting is only a click each (and thats the advanced mode.)

Because its considerably faster, they claim. https://brave.com/improved-ad-blocker-performance/ https://github.com/brave/adblock-rust

They rewrote ublock origin in rust, and its native to the product, not tacked on. Shady business model aside, they are making technical contributions to the world.

That's an idea I had for a few years now. I started some motions [0], but progress was slow, because of life. I wanted to start with going through the Common Crawl [1] data at first for testing purposes and to calculate a rough percentage of sites being uBlock-Origin clean.

I think that such sites would be in ballpark of a few ‰. That would enable me to offer the contentless index for download. With delta updates and torrent for distribution it could be not that expensive, but that's a thing that I could charge for.

My intention is to use AdBlock rules like easylist to check whether or not indeed the page.

My initial code is fine in Go, but I lost enthusiasm for Go lately and careerwise it's not a good fit for me (I don't have much time to learn something not as useful for me professionally). So I started to rewrite it in Rust, while learning it, you can laugh now (Rust Evangelism Strike Force el oh el). It has an advantage with ready to use rules parser from Brave [2] and presumably high quality tokenizer from html5ever [3].

I want to use a tokenizer instead of a full parser to be able to do stream processing bringing costs down.

Common Crawl data lays on S3 so the processing must be done initially on EC2 to keep it low cost.

[0] Current Go code: https://github.com/hadrianw/abracabra

[1] https://commoncrawl.org/

[2] https://github.com/brave/adblock-rust

[3] https://docs.rs/html5ever/0.25.1/html5ever/tokenizer/index.h...

EDIT:

Also for the search part I want to use something more stand alone than Elasticsearch to offer desktop search with downloaded index. When I started with Go I wanted to use Bleve [4], now I'm not sure, but I think that Bleve is getting mature enough. I will worry when I will have some data to search through.

One of the challenges with this whole enterprise is a small need of JavaScript parsing. There is a common pattern, that for example Google Analytics uses, that uses a snippet of JavaScript to insert a proper script tag. But those snippets are very short so I think they may not need a full JS VM, maybe even a tokenizer would be good enough. Browser AdBlockers base on the site executing JavaScript already.

[4] https://blevesearch.com/

I welcome more competition in this space, especially ones that operate at a different abstraction level than others, but this one doesnt look active anymore.

I know brave isnt the most popular product / business model, but their rust reimplementation of the Adblock Plus syntax, a rewrite of uBlock Origins and Cliqz, might hopefully be a valuable contribution to the open source world.

Regardless of how people feel about the ethics of ad blocking, being able to dynamically block parts of websites has become as or more important than anti-virus, for safety.

https://brave.com/improved-ad-blocker-performance/

https://github.com/brave/adblock-rust

Although it will make troubleshooting a nightmare, necessary protection at multiple levels of the stack is becoming a reality. NextDNS (or quad9, pihole, adguard) combined with Brave (or uBlock Origin, Cliqz) in combination are going to keep people safer, despite the shortcomings of both dns based and active page filters and parsing.

It would be nice to be able to manage and maintain filter list configurations across all browsers, devices, and dns. Some sort of central management that updates and propagates NextDNS, Brave, uBlock Origin, uBlock Matrix, and Dark Reader. uBlock Matrix and Dark Reader are especially cumbersome to use between Chrome and Firefox on different devices.

Brave is open source, so their ad blocking mechanisms are transparent:

https://github.com/brave/adblock-rust

Here is an excerpt of the read.me:

It uses a tokenisation approach for quickly reducing the potentially matching rule search space against a URL.

The algorithm is inspired by, and closely follows the algorithm of uBlock Origin and Cliqz.

It's also worth mentioning that Brave's adblock engine is native (written in Rust), not a Javascript-based engine like uBlock [0]

[0] https://github.com/brave/adblock-rust

According to https://github.com/brave/adblock-rust they use a similar algorithm as uBlock Origin. So not really "new", just reimplemented in rust.