How Do Ad Blockers Work, Exactly?

by Dan Moren

Whether you own an iPhone or iPad or you’re just a casual observer of the tech scene, you’ve probably heard about the new “content-blocking” capabilities built into iOS 9. If you have, you’ve probably found yourself wondering what all the fuss is about. If so, you’ve come to the right place: Here’s what you need to know to sound savvy about the subject at your next soirée.

What exactly is content-blocking?

In its most general form, it’s exactly what the name suggests: It’s the ability to prevent certain types of content from appearing in a Web browser. In truth, though, it’s almost exclusively targeted at one particular form of content: Web-based advertising.

But wait: Ad-blocking software’s been around for years. Why the big deal now?

True enough: Ad-blocking software has been widely used on conventional computers for almost as long as there’s been online advertising. It’s been available on non-Apple mobile platforms, such as Android, too. But iOS 9 marks the first time such software has been supported on Apple’s mobile platform — which represents a big and influential chunk of mobile Web browsers.

So how does content-blocking work on iOS 9?

The reason we haven’t had content-blocking on iOS 9 before is that Apple’s mobile OS was too locked down: Developers couldn’t create plug-ins that would interact with Web pages as they load. But in iOS 9, Apple has specifically created a system enabling third-party developers to create content-blocking software. (Note that Apple isn’t itself creating the content blockers, merely providing the capability for others to do so.)

Safari’s Content Blockers settings

You can now buy such content blockers on the App Store. (In fact, they’re among the best-selling apps there.) If you were to download any of them, you could see a list of them by opening the Settings app and going to Safari > Content Blockers. A list of installed blockers would appear, along with controls that allow you to enable or disable each. (Yes, you can have more than one installed at a time.)

What exactly do these content blockers, well, block?

That depends mightily upon your content blocker of choice. In some cases, they aim to wipe out all advertising on a Web page. Others specifically target what they consider to be privacy-violating behavior: Trackers, for example, which some websites deploy in order to follow your Web-wanderings from site to site — generally with the goal of serving you targeted advertising. Still other blockers target elements of Web pages they find annoying, such as those buttons that encourage you to share content on Twitter and Facebook.

Aside from privacy concerns and ads, are there other reasons to run a content blocker?

In a word, performance. Here’s the thing: Individually, those ads and trackers that run when you launch the page are pretty small. But add them all up and they start consuming significant resources, in terms of both the data that needs to be loaded and the time it takes to load it. Bottom line: Webpages with lots of ads, tracking code, and the like take a lot longer to load and, if you’re on a metered cellular data plan, chew through more of your data.

All those ads (and all of the code that places them there) take up time and bandwidth.

What kind of sorcery is behind these ad blockers? How do they figure out what to block?

Broadly speaking, content blockers work a bit like the spam filter on your email client. As a webpage loads its many elements — scripts, code, images, and so on — the content blocker checks them to see if they match its set of criteria. Those criteria might include a particular identifying tag (if, say, an element is labeled “ad”), a particular type of content (such as a cookie or JavaScript), or even a particular URL (if, say, a webpage tries to load a known tracker from Google Analytics). The blocker can then tell the browser not to load or display that element.

Different content-blockers give you different options for what they’ll block.

How broad the blocking is depends on which content blocker you’re using. Some, like Purify or Crystal take a “one big switch” approach that blocks pretty much everything. Others, like 1Blocker, take a more granular approach, allowing you to choose specifically which elements you want to block, as well as creating a “whitelist” of sites on which no ads will be blocked.

But so many of the sites I read are supported in part by ads. Is blocking them ethical?

Well, now you’ve reached the core of the controversy. There are those who argue that content-blocking hurts sites that rely on ads to sustain themselves; opponents contend that ads are fair game because of their user-hostile behaviors, such as tracking and excessive resource consumption. My colleague Rob Pegoraro has an excellent summary of the issues involved. Ultimately, it’s up to you.