Hacker News new | past | comments | ask | show | jobs | submit login

And ironically Safari has the worst adblocking capability of the 3. Open source is the only effective weapon against corporate control of software.



Safari's (Webkit's) declarative adblocker is really good while optimizing for performance and battery life.

Have you tried 1Blocker X?

Though, for fun, I've rolled my own Safari extension for content blocking. You get 90%+ of the way just concatenating lists of ad domains and feeding them into the blocker. But, for example, you can encode all of Easylist as content-blocker rules.


Chrome is now moving to a declarative model and it is widely considered to be a downgrade purposely meant to stifle ad-blocking technology.

I think the ideal system would support declarative and non-declarative modes (since a fully declarative system could never account for every possible use case).


I can see that given the choice between declarative rules vs. a "onRequest(req)" handler, almost every developer would just opt for the latter because it's more general and open-ended.

And there's no pressure from users to choose the more restrictive but performant option because people basically have zero insight into what's killing their battery, much less which competitor is better in that regard.

Given the gulf between Safari vs Chrome battery performance, I'm not all that convinced that the declarative api is pure downside like HN cynicism and Twitter outrage might suggest.

I can agree that it would be nice to have competing implementations, but that's just the result of browsers being so complex that once your hobby horse feature is removed from one, you basically have nowhere to turn.


> Given the gulf between Safari vs Chrome battery performance, I'm not all that convinced that the declarative api is pure downside like HN cynicism and Twitter outrage might suggest.

Safari was already beating Chrome on battery life before its extension API was neutered. This is post hoc revisionist rationalization.


So obviously the correct response from the Chrome team is to continue avoiding an approach that is known to save battery life /s


To clarify: Safari was already beating Chrome on battery life before _Safari's_ extension API was neutered.


What's your point? That Chrome now can't adopt Safari's extension API to save battery life because...? Improving Chrome's battery life by adopting a simpler extension API helps close the gap. That's a significant benefit whether or not Safari did it first or whether Chrome still has room for improvement.


The grandparent was implying that Safari's better battery life justifies their decision to use the declarative API. But that was already the case before they adopted the declarative API, so it's not obvious that the declarative API has anything to do with that success. Maybe it's just a minor improvement, or maybe it isn't an improvement at all.


I'm not sure how you could make that argument and ignore the fact that the declarative API is technically simpler and its battery benefits are apparent from that aspect alone.


It's not apparent that the benefits are significant in any way. They could be minuscule and therefore not worth sacrificing important user experience features like adblocking over.

It could also be that because of the reduced expressiveness of the adblocker, more ads are missed, and you might therefore end up with a net increase in the amount of code that has to be executed by the browser. So the declarative API could actually lead to a performance decrease in practice.


The Chrome team has already evaluated the change and explain why the benefits are not miniscule [1]:

> In addition to these safety concerns, there are also significant performance costs. In most cases, these costs are not from the evaluation of the extension script processing events, but rather from everything else coordinating the script. That overall performance impact can be very large, even for an extension written as performantly as possible where the JavaScript execution time is negligible.

> As it’s designed today, the blocking version of the Web Request API requires a persistent, long-running process, and is fundamentally incompatible with “lazy” processes - processes that can be set up or torn down as-needed, conserving valuable system resources. There are also significant costs associated with the serialization of the request data, the inter-process communication needed to send that data to the extensions, and the processing of extension responses.

You are free to dismiss the writeup as lies, of course. You're also free to handwave it away by saying "well I don't like the trade-off". But you can't discuss this as if the benefits are not apparent.

[1] https://blog.chromium.org/2019/06/web-request-and-declarativ...


This blog post is highly misleading. For example, they start off with several paragraphs about security/privacy implications, but this change doesn't have any security/privacy implications. That's because they have explicitly stated that they will not deprecate the observational webRequest API, which has exactly the same privacy considerations as the content blocking API. However because the observational API provides "important functionality for which there is no alternative" (to their tracking business), it will not be deprecated. But the content blocking API which also provides important functionality for which there is no alternative (but hinders their advertising business) is being deprecated.

Furthermore here you can see a tweet from Justin Schuh, lead of security and privacy on Google Chrome, where he claims that the "sole motivation is correcting privacy and security deficiencies" (which I just debunked as being a possibility), not performance: https://twitter.com/justinschuh/status/1134092257190064128

So between Justin Schuh and Simeon Vincent (author of the post you linked), who is lying? It must be at least one of them.

But let's ignore the misleading claims about security/privacy and just focus on the performance issue.

In this post, they include absolutely no numbers or measurements of the performance effects of using the content blocking API. They give some explanation of what is technically required to implement each approach, and certainly the declarative API is a simpler approach, but you made that point already. And I responded to it. Just because the API is "obviously simpler" doesn't mean the performance advantage is in any way significant, and could even be outweighed by the increased ad load due to the less powerful API. It's just not at all obvious from what they are saying here that the change is worth compromising user functionality over.

If you want a source with actual measurements, you should check the Ghostery team's response to the manifest v3 changes: https://whotracks.me/blog/adblockers_performance_study.html

Here are some highlights:

> All content-blockers except DuckDuckGo have sub-millisecond median decision time per request.

> Time to Process a Request in Ghostery (median): 0.007 ms

> Loading Ghostery's Blocking Engine (from cache): 0.03 ms

> Memory Consumption of Ghostery's Blocking Engine (at startup, in Chrome): 1.8 MB

Note that last one: 1.8 MB memory consumption. And they're arguing that we need to be "setting up and tearing down this component as needed" to conserve that "valuable" 1.8 MB. Nonsense.


None of this is particularly convincing.

> That's because they have explicitly stated that they will not deprecate the observational webRequest API, which has exactly the same privacy considerations as the content blocking API.

It's still a substantial improvement if popular extensions that don't need to use observational webRequest (ie. content blockers) no longer use this more expensive method. It's a leap of logic to suggest that supporting observational webRequest means that the simpler content blocking API has no benefit.

> Furthermore here you can see a tweet from Justin Schuh, lead of security and privacy on Google Chrome, where he claims that the "sole motivation is correcting privacy and security deficiencies" (which I just debunked as being a possibility), not performance (...) So between Justin Schuh and Simeon Vincent (author of the post you linked), who is lying? It must be at least one of them.

Neither. The change may be motivated by privacy and security but as Simeon Vincent explains, it also has substantial performance benefits. I'm not sure how you logically leap to the conclusion of "this has no performance benefits" from "we did this for privacy/security reasons".

It's also extremely misleading to compare the performance of a content-blocked site to internal browser performance. You know what has the best overall performance? An extension that blocks the whole page; 0ms speed, the best performance, almost zero battery drain, except that this hypothetical extension consumes substantial resources on its own. But hey, the 0ms page speed makes up for it. It'd be pretty silly for the Chrome team to base their decisions on the performance of rendering an incomplete webpage depending on both random extension makers and random website creators.

> Note that last one: 1.8 MB memory consumption. And they're arguing that we need to be "setting up and tearing down this component as needed" to conserve that "valuable" 1.8 MB.

Ghostery is only one extension among them, and all the adblocking extensions in that performance study ran a pre-pruned set of EasyList rules when popular adblockers run more rules in practice.


Static blacklists versus live heuristics is a pretty obvious compromise, and prone to lose in the long term arms race. That's exactly why Chrome proposed manifest V3...which is basically implementing Safari rules.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: