Notes to Future-Me


Deploying Simple AdBlocker on MacOS/iOS

Posted: 2024-01-17
Tags: Xcode, Security

Commercial ad blocking extensions make their money by collecting data on their user’s browsing. Very few open source projects have extensions for Safari, so we roll our own


Prerequisites

Apple’s Xcode IDE is necessary to compile and deploy the extension. It is free.

Either a paid Apple Developer Account is required, or a locally issued signing certificate.

Acquire the Source Code

Select Team


Deploy to MacOS

Build and Deploy the App

This should build and run the AdBlocker app, which contains the extension and registers it with Safari. The extension must still be turned on in Safari.

Enable Unsigned Safari Extensions

Enable the Extension in Safari


Deploy to iOS

Build and Deploy the App

If this is the first thing deployed to the iOS device with this signing certificate, then the certificate must be manually added to the trusted list.

This should build and run the AdBlocker app, which contains the extension and registers it with Safari. The extension must still be turned on in Safari.

Trusting the Signing Certificate

Once you deploy the app to your iOS device:

Enable the Extension in Safari