Bleach
Bleach copied to clipboard
iOS 9 app extension to block ads
Bleach
The goal is simple: block ads and stuff.
How
For years, I've been using an awesome hosts file to redirect requests to sites that serve ads to 127.0.0.1. It's OS-wide, so it works on all your browsers. It shouldn't be difficult to download the file and parse it into the JSON that Safari content-blocking extensions use.
Challenges
It's going to be tricky for a few reasons.
- Sometimes you want content that's blocked by the hosts file. For example, clicking on Google Ads (which aren't blocked) doesn't work anymore.
- As an iOS developer, it makes it hard to use and test analytics libraries.
- I want to support the maintainers of the hosts file as much as possible, in some way. It may run afoul of the IAP rules.
- Apple may not like the idea of an app downloading an arbitrary list of thousands of domains to block content from.
- The scale of it may be too much for the APIs to handle.