Content Blocking Safari Extensions, as Apple calls them, are filters created by third-party apps. The apps either include a prefabricated and updated list, or offer options to configure which kinds of content to block, including whitelisting and blacklisting sites.
The filters start with a URL pattern using standard “regexp” (regular expression) pattern, which can match an individual page on a site, every kind of page or media of a certain kind, or patterns across all sites. An optional media type can be noted, too, like a document or video. Before Safari loads a page or item referenced on a page, it matches against these URL patterns. If there’s a match, the entire page or item may be blocked, or just an associated browser cookie or page elements defined by style sheets. Filters can also block content referenced on a webpage that originates from a domain other than that of the webpage.
This allows a lot of customization. Entire sites can be fully unavailable—blacklisted from loading. Or all bandwidth-consuming media (audio, video, and other types) can be suppressed on low-bandwidth or high-cost connections. Every app is approaching this differently.
Let’s roll up out sleeves and see what they can do.
(For the down-and-dirty details of how content-blocking extensions work, read “What lies beneath: What you need to know about content blockers in iOS 9 Safari” or the Apple WebKit team’s blog entry with even more technical talk.)
Apple doesn’t include content-blocking extensions in iOS 9; it just lets them happen. They aren’t full-blown extensions, such as are available in desktop browsers like Safari. Those kinds of add-ons or plug-ins can add new ways to view media or control basic browser behavior. Instead, content-blocking extensions are a list of patterns and behaviors that a third-party app passes to Safari, which collects and compiles them from all enabled apps into a fast-loading filter set.
First, you need to get one or more apps. Since I’m writing this on iOS 9’s release day, only four content blockers are available right now. I beta tested several, and will update this article with more detail as they can be purchased or downloaded.
(Note that not all iOS devices are supported that can run iOS 9: only those with 64-bit processors. This excludes the iPhone 4s, 5, and 5c; the iPad 2, 3rd-generation iPad, and 4th-generation iPad; 1st-generation iPad mini; and the 5th-generation iPod touch. All later devices work.)
You can have any combination of content blockers enabled—or none—at any given time, so you don’t have to choose the perfect one. I expect there will be many kinds with distinct purposes. You may easily have two or three, or ones you turn on and off depending on where you’re browsing, your available bandwidth, and even the cost and amount of data transfers when you’re roaming off network or internationally.
Once you’ve installed one or more content blockers, you need to configure them if they offer configuration options. Launch the app to fiddle with settings, if any are available. Some apps will have no settings, but simply incorporate a list that’s updated remotely. Others will have huge numbers of options, down to letting you turn a filter on or off for particular sites.
Apple has a “firewall” of sorts in place: filters don’t feed information back to apps. The filters are passed from an app to iOS, which compiles them and uses them with Safari. But Safari and iOS don’t return that favor, as they don’t tell apps what items were blocked. Some apps offer Share extensions that you can use within Safari that let you opt into passing some data back, like whitelisting a site you’re on.
Finally, you have to enable filters individually for Safari. Tap Settings > Safari > Content Blockers, and you can flip a switch on or off for each installed extension. Whenever you do so, iOS quietly rebuilds the filters being applied—there’s no extra step.
Content blockers can take a lot of different paths:
Another variable will be the source of block lists, whether it’s for privacy, advertising network, anti-phishing protection, or bandwidth reduction. Crystal’s developer adapted and reduced AdBlock Plus’s EasyList. Marco Arment licensed Ghostery’s database for his Peace blocker.
Several apps I tested put items into the Share sheet for Safari. Peace, for instance, offers Open Unrestricted, Open in Peace, and Peace Settings, which correspond to bypassing filters, using a Safari View Controller to load pages bypassing Peace, and open Peace’s settings. The Safari View Controller is new in iOS 9, and is a full-featured embedded Safari browser that app developers can use—and which includes content-blocking filters—as opposed to the previous web views that were subsets of Safari’s abilities.
Apple also built in a way to bypass all content filters, but only for a single page. After a page loads, press and hold down the refresh button. A pop-up or popover appears with Request Desktop Site, a previously available option hidden in a different place in Safari, and Reload Without Content Blockers. That reload only bypass filters for the current page. The next tap loads using the filters.
In testing, I looked at how rapidly pages were ready to use, rather than the complete load time. In many cases, because mobile versions of sites don’t include auto-play video or are already optimized for smaller screens and less available bandwidth, the difference was minimal; in others, it could take twice as long, but still be just a matter of seconds.
For the most part, behind the scenes is where the real action is happening. Blocking known trackers prevents privacy leakages of your actions, including your path across different sites. Blocking advertising networks can dramatically reduce bandwith consumed. At many sites, people are discovering, video loads in the background even when it never plays nor slows down the main page display. Some testers have found a 10MB to 15MB page load drops to 2MB to 3MB when content blocking is enabled, even when the loaded page shows omits one or two missing ads.