An introduction to WebKit content blockers


As someone who makes content, I never block it. That's because I want more content and blocking it will lead to less. That said, I'm trying to understand content blocking and what it means not just for my work on the web, but my life on it.

I had the chance to talk to several people about the technology at WWDC 2015 and it's absolutely clear to me no one is making content blockers to hurt any creators or any companies. They're doing it to give people more control over what they see, hear, and experience on the internet. It's a tool, and how it's used will determine if it's good or bad for you, me, and the websites we all know and love.

The WebKit blog, Surfin' Safari, has posted some more information about what content blockers are and how the extensions work.

We have been building these features with a focus on providing better control over privacy. We wanted to enable better privacy filters, and that is what has been driving the feature set that exists today.There is a whole universe of features that can take advantage of the content blocker API, around privacy or better user experience. We would love to hear your feedback about what works well, what needs improvement, and what is missing.A major benefit of the declarative content blocking extension model is that the extension does not see the URLs of pages and resources the user browsed to or had a page request. WebKit itself does not keep track of what rules have been executed on which URLs; we do not track you by design.Everything has been developed in the open; everyone is welcome to audit and improve the code. The main part of content blockers lives in Source/WebCore/contentextensions.

If you're considering making or using a content blocker in Safari for iPhone or iPad, read the rest and let me know what you think and why.

Rene Ritchie

Rene Ritchie is one of the most respected Apple analysts in the business, reaching a combined audience of over 40 million readers a month. His YouTube channel, Vector, has over 90 thousand subscribers and 14 million views and his podcasts, including Debug, have been downloaded over 20 million times. He also regularly co-hosts MacBreak Weekly for the TWiT network and co-hosted CES Live! and Talk Mobile. Based in Montreal, Rene is a former director of product marketing, web developer, and graphic designer. He's authored several books and appeared on numerous television and radio segments to discuss Apple and the technology industry. When not working, he likes to cook, grapple, and spend time with his friends and family.

  • If there was any kind of security standard for web ads, I might not block them as well. As it stands, ads are one of the main ways that computers get infected with malicious code. The TWiT site has been taken down a few times because Google blocked it as an attack site due to malicious code served by their ad provider. The folks at TWiT know what they are doing. You know that a mom and pop web site won't have a clue about how to block bad ads. Since I have run an ad blocker, I get no infections and the web runs a lot faster.
  • Not only that, but stop loading the page down with so many stinkin' ads that even on a decent broadband connection (24+ Mbps) the page takes forever to load. One or two ads is enough, not six or more ads taking up valuable space on the page.
  • Something really needs to be done about auto-launching video as well. I'm ready to castrate assholes who stick that crap on a page.
  • i block everything as i don't like unnecessary junk on my screen and also indeed most adverts are full of poising (malicious software / spammers / etc). also when i'm on 3G or any other pay per Mb i don't want to pay for junk i don't read / want, simples.
    it's shocking how much trackers this iMore web site has... 12!!!
  • Blocking advertising is the right of every internet user IMO. The absolute number of people who do it is so low, that it actually doesn't affect a sites revenue model and the suggestion that it does is wrong. It wasn't that long ago that the Internet had NO advertising at all and it did just fine. At the time, there was actually a big, internet-wide discussion over whether advertising should be "allowed," and the general consensus from the users was ... no, it should not. The powers that be (capitalism, advertising companies etc.), decided to go ahead anyway, but since no agreement was ever actually obtained from the users, it's perfectly valid to consider all advertising as "optional" and to be avoided. There is nothing immoral or "wrong" with blocking advertising. It breaks no contracts (social or otherwise), in fact, quite the reverse.
  • I don't personally block ads because I feel it is, in large part, the way content I enjoy, such as iMore, survives. However, I would love to have something that would protect against hijack ads. My wife, looking up something about a school board, got an iOS targeted hijack. Kept telling her to call to have safari (lowercase) in IOS (all caps) cleaned. Let me tell you, it is a pain the the tuckus to fix, and relies on perfect timing. (Though as a POC, I tried it on my iPhone, and used iCloud tabs on my Mac to get rid of it). If this extension class opening by Apple leads to ways to prevent that, I am all for it. Sent from the iMore App
  • It was also not that long ago that all the time and effort of content creators on the Internet was given for free, with no possibility of someone to make a living solely as an Internet content provider. Merlyn Mann, John Gruber, iMore, ign, Hulu, etc. wouldn't exist on the Internet as they do today without advertising.
  • No complaints at all for advertising done right, like those on Daring Fireball. It’s the flashier, jump-out-at-you, block-the-page, redirecting sort of ads that are an annoyance. Don’t forget those that automatically opened the AppStore on our iPhones. Ugh.
  • When was this "not that long ago"? I can remember clickbait flashing banner ads in 1998.
  • No, the internet wasn't "just fine". It was tiny in comparison. Seriously, have fun with your few websites and almost no content. People don't do this for free, nor should they. And if you want to block ads, you should get off this site because the people here obviously aren't good enough to get paid in your eyes.
  • RE: "Blocking advertising is the right of every internet user IMO"
    This x 1 with a 100 zeros behind it (no pun intended). If ads and social tracker/share buttons were laid out more tastefully, I wouldn't have an issue with them. Even ignoring the risks to security, privacy and overall bloat added to the internet, most ads simply block the flow of a web page as if their only purpose in life was to annoy us, and almost all that do that are plain ugly to boot. Sure, its "strategic" to place ads where people are most likely to see them, but how many times have you gone to a page (especially on mobile browsers) and tapped on a link, only for an ad to appear on that exact same spot your finger was zeroing in on because the page hadn't fully loaded yet, opening a new tab (or worse, some crazy App Store redirect) as a result. It's happened way too many times to be considered a coincidence. To me, that's beyond strategic - it's downright criminal.
  • Obviously nobody can stop readers from using ad-blockers, but that doesn't mean there's no fallout from it. Even if any given reader is alright with alternatives like paywalls or native ads that arise when banner ads become less effective, I imagine the majority will be less cool with them than traditional ads.
  • Besides security standards as mentioned there should be other standards that ads should be guided towards. For example a user should have the choice in what form an ad is displayed. Like in iPhone I can choose if I want my notifications as a popup, as a banner and so on. Some ads manage to ruin whole websites especially on mobile because they create a layer on top of the content and it's nearly impossible to close them because the closing button scrolls off screen. Sent from the iMore App
  • Perhaps, by implementing something this major, Apple will force the hand of advertisers (and content creators) to integrate user-friendly, more secure ads that don't annoy users. is an example of a site which is ten times slower to read because of its ads. Personally I think there is a new model to evolve here. As a fan of reading things in RSS format where possible, I'm constantly frustrated by feeds which only allow the reading of headlines. However, if those sites agreed to place full articles to services like freely, and if freely agreed to pay those sites for hits from their service, then, and only then, I would consider upgrading to Feedly pro or one of the other paid for reading services. No ads. Easy to read. And supporting everyone. Sent from the iMore App
  • Freely? FEEDLY. #DYAC Sent from the iMore App
  • I use AdBlock, but I specifically turn it off for many websites including
  • I would rather (and do) pay a small fee to have ads removed from a site which I enjoy their content. To me thats a win-win, content creators get paid, and I get no ads. Unfortunately, a lot of sites that I like do not offer this option.
  • I run adblock, but white list sites I frequent. But some places are absolutely insane with ads. I was looking for a car recently, and when you visit the KBB site, you'll block about 30-50 ads per visit. That's one vehicle page. Sloths fight leopards. You can't open a bag of chips. Clearly humans are the weaker species.
  • I've been using ads on my website for quite a long time now, and even with the vast majority of people using adblockers (including myself) I am still able to earn money with it. Not as much as what I earn from my partners, but it's still a good amount. Anyway, as mentioned in some comments as well, the problem is that some websites (read: most websites) are using so many ads that it becomes annoying. I often visit website where there's an ad that takes up the whole screen. I then feel inclined to leave that website. My father has the same on his iPad.. Constantly getting a huge ad, forcing him to tap that 'x' button (IF it's there) and then it takes a while to load all the content. That doesn't work. It is bad for the user experience and it forces a lot users to not use that specific website anymore. The result? The website will lose all those users. Now I'm talking about a small amount of users, but you get the idea. The best solution is to display ads without users getting annoyed by them is to use NORMAL ads. Ones that don't cover the whole display especially. I think that this new content blocker thing for WebKit will be a great move. Just like some other Ad Blocker users do, I always unblock ads from some websites. But only those I visit (almost) every day.
  • I'm fine with ads and I understand that ads pay for the sites I enjoy. However, ads that distract are an abomination - autoplay video and audio, gifs that jump around, ads that slide in new content every 10 or 15 seconds. Similarly, some sites load up, then when you've read a few paragraphs and scroll down, they throw up a page-covering modal dialogue. What the hell is wrong with advertisers that they want to annoy me to get my attention? I have an ad blocker and will use it on those types of ads. In practice, this turns out to be about 10% of the ads I currently run into. Rene, this situation is just example #1,343,987 of parasites taking advantage of an ecosystem. At some point within the next several years the bad advertising will drive out the good, and iMore will either start running bad ads or go out of business. Sad but true.
  • The only ad blocking I do is because of my own personal crusade. I can't stand Flash and I block it at all opportunities. I've developed on the platform in the past and I prefer HTML5 and web standards. That's where my line in the sand is drawn.
  • For an extremely thorough, if somewhat triumphalist, exposé of the manner of and rationale behind the new blocking, have a look at this piece in Appleinsider. Looks like Apple may be moving the Internet to the app universe: the macrocosm recreated in an atom-sized universe. Sent from the iMore App
  • At least we have the option of blocking ads now and that's all that matters. If some sites actually slimmed down on ads then it wouldn't be a problem but pop ups and auto playing videos are annoying. uBlock and Ghostery are the way to go in my opinion. Options are good and the option to block content is great Posted via the iMore App on my iPad Air or iPod Touch 5