Damon Wagner
Damon Wagner

Reputation: 1

How to create a content blocker for ios?

Pre-requisites: Xcode: 14 iOS: 16 Device: iPhone 14

Trying to create a simple content blocker using the content blocker extension from the Xcode. Steps to reproduce:

  1. Create a simple Xcode Project.
  2. Add a new target -> Content blocker extension
  3. Give a name to the target.

You will see 2 files:

  1. ContentBlockerRequestHandler.swift
  2. blockerList.json

What I'm trying is adding a site in blockerList.json file:

{
    "action": {
        "type": "block"
    },
    "trigger": {
        "url-filter": "www.google.com"
    }
}

After running the same in iPhone 14 it's not blocking google.com.

P.S: Content blocker is enabled in the safari settings and extensions are toggled on in safari extension part.

Upvotes: 0

Views: 628

Answers (0)

Related Questions