An hour with Safari Content Blocker in iOS 9

I took a little time out today to watch WWDC Session 511 to learn about how Safari Content Blocking will work in iOS 9 and OS X El Capitan. After an hour, I had a little concept app running. I wont really explain the technical details of how the extensions work or how to create them, that is better done by watching the WWDC Session video directly, but I will say its frightfully easy and the code I used for the blocker detailed below is at the bottom of this page. 

Ok, so the website I decided to try "fixing", is one that I see linked often, iMore. Let me start this by saying I really like the content that iMore provide and enjoy the personas of their staff on their many podcasts (Debug is one of my favourites!), but I hate the experience of their mobile website as it has several ad's by many different providers, all tracking me across all different sites. They have super tiny 'close' buttons that are near impossible to hit, they follow you as you scroll and there is a slow loading full page interstitial that loads on every page refresh. Urgh! Anyway...
 

Looks

Here is a screenshot of before & after the content blocker has run.

Space Grey @3x + IMG_8111.png
Space Grey @3x + IMG_8111 + IMG_8114.png

I don't know about you, but I think this website looks a lot more better now. The content I want to see is there in front of me, uninterrupted and free of clutter.  (note: I dismissed the App Store banner at the top and couldn't get it to reappear for the second screenshot). 

 

Performance

With no content blocked, there are 38 3rd party scripts  (scripts not hosted on the host domain) running when the homepage is opened, which takes a total of 11 seconds. Some of these scripts are hosted by companies I know, Google, Amazon, Twitter and lots from companies I don't know. Most of which I assume are used to display adverts or track my activity, as the network activity was still active after a minute of leaving the page dormant. I decided to turn them all off all 3rd party scripts and see what would happen. 

After turning off all 3rd party scripts, the homepage took 2 seconds to load, down from 11 seconds. Also, the network activity stopped as soon as the page loaded so it should be less strain on the battery. 

I later blocked the CSS div's reserved for ad space and for the rotating carousel at the top as one of the scripts i blocked broke the functionality and I didn't really like it enough to fix it, for details, see the copy of my JSON below. 

Would I block content? 

Now, this was fun little project to mess around with, but it does give me a moral dilemma. Do I care more about my privacy, time, device battery life & data usage or do I care more about the content creators of sites I visit to be able to monetise effectively and ultimately keep creating content?  

Tough question. At the moment, I don't know. 

If anyone wants to play around with my (very limited) Safari Content Blocker Extension, here is a copy of my JSON

My OS X Setup - The Dock

My favourite part of setting up a new computer is installing applications. It's a great opportunity to revaluate what applications you currently use, and try out alternatives.

The Dock is a great place to start, as that is where my most used applications live. 

iTunes - Surprise surprise, I use this for music & movies. I don't store much locally, as most of my music streamed via iTunes Match. Also there are countless movies that I have acquired over the years from iTunes.

iBooks - I've only just started using iBooks on the Mac, mainly for reading documentation, such as The Swift Programming Language. I still don't enjoy reading novels from a laptop, so I stick to my iPad for that. 

Safari - My favourite way to browse the web. I love that Keychain creates, saves and syncs unique passwords for me across the web straight to my mobile devices. More recently, I have ditched my regular RSS reader and Instapaper to make use of Safari's Shared Links and Reading List. So far, it is working well. I especially like seeing links from the people I follow on Twitter show up in-between my RSS items.
Note: RSS Subscription are only available in OS X Yosemite & iOS 8 versions of Safari

iMessages - The main way I stay in touch with people, especially since Yosemite has added support for "Green bubble friends"

Tweetbot - My favourite Twitter client. It syncs my reading spot with its mobile counterparts, along with mute lists.

Sketch - I've always used Adobe's creative suite's for graphic design, but I've never loved using it. I am trying to steer clear of Adobe's software as I've found its very bloated for my simple needs, occasionally buggy, expensive with subscriptions... Basicallly, I don't find myself to be the market Adobe are trying to target. Enter Sketch. A beautiful, lightweight design tool made from the ground up for Mac. It also has an iOS app called Sketch Mirror, which allows you to beam the workspace you are currently working on to an iOS device, great for when working with UI mockups. 

Xcode - If you don't know that Xcode is, chances are you don't need to know, but for the curious, its a tool that Apple releases that allow developers to create rich applications for OS X & iOS. I am currently working with the latest beta, getting deep into the new programming language that Apple released at WWDC earlier this year. My favourite new feature has to be Playgrounds. It is just so fun to use when prototyping segments of code, mainly due to the real time feedback it gives you as you write. 

Home Folder - Ok, so not an application, but it allows me to instantly look at the root of my home folder. 

Trash Can - Such a pretty icon in Yosemite, don't you think? 

Currently Missing: I have yet to settle on a writing application for OS X and iOS. Writer.Pro was my previous favourite, but I am going to do a little research and look for an alternative. A great photo management application is also missing. Over the years I have amassed just over 150gb of photographs, which need a home. I have decided against my previous tool, Lightroom, due to my Adobe boycott, although the alternatives are not much better. Apple's very own iPhoto and Aperture has been discontinued and are due to be replaced by iCloud Photo Library, which I think I will transfer to in future, although there is no OS X app for it yet.