Hacker News new | ask | show | jobs
by isykt 1029 days ago
What Adblock features are missing on iOS?
2 comments

iOS (and macOS Safari) only has the stupid "declarative blocking" functionality which is trivial for ads to bypass. In addition, it often breaks websites because it can't inject runtime code (like uBlock filters can) to substitute malicious JS payloads with neutered versions that still expose the same API so the rest of the JS doesn't error out.
That’s false. iOS has had full-fledged extensions for years now. Nothing stops uBO from existing on Safari other than stubbornness.

Most serious iOS content blockers ship both a native list (or multiple) and an active counterpart, usually focusing on YouTube ads.

However I am aware that adblocking is still poor on Safari, maybe nobody just can match uBO

You are mistaken. Safari removed the APIs necessary for an uBlock port (there used to be one), see https://github.com/el1t/uBlock-Safari/issues/158.

Injecting code via Web Extensions is too late for reliable blocking - by then, either the malicious JS you are trying to defuse has already ran (if it wasn't blocked declaratively), or if not then the rest of the page's JS depending on it has already exploded and "fixing" it after the fact (by substituting a neutered shim via Web Extensions) doesn't fix the rest of the page.

In theory you are right, in practice it works just as well.
That depends a lot on the site. It works well on some, but on others it's just not enough.

Safari/iOS blocking is closer to uBlock Origin than to DNS blocking, but is not as powerful as uBO and some sites "exploit" those limitations.

No, it really does not. My iPad with safari and safari filters next to my android with firefox + ublock is nowhere near as comprehensive. Even news websites sneak ads into safari.
Got any example urls handy? I’m using AdGuard and i just don’t recall getting ads anywhere i visit. I’m interested to see if any slip through.

The only exception i can recall right now was youtube but SponsorBlock does great there in Safari.

Browser extensions, which can block HTML elements based on arbitrary selectors rather than just origin domain.
Safari does actually support CSS selectors in its content blocking API. However, see my other comment on this very subthread, it's nowhere near enough and is trivial for ads to bypass.