ILikeTau ILikeTau - 2 years ago 87
iOS Question

Reloading Content Blockers in iOS

I have heard that iOS has support for content blockers, and that all blocking is done by a file called

that resides in the App Bundle. While I know that
will reload the data in
. However, I don't see any use in this; the
is part of the main bundle and can't be modified. Thus, is there any way that the
can be modified (or the extension can point to another file, be deleted and recreated, not use json, etc.)?

Answer Source

You don't have to use blockerList.json from the bundle as your JSON source. There are a couple different things you can do to dynamically change the content blocker.

  1. You could have the extension download a new JSON file from a server and update the blocker when triggered by the app
  2. Put the app and content blocker extension in the same app group so data can be passed between the two and then do one of the following:
    • Have the app create/modify a JSON file in the shared group directory that will be read by the extension
    • Have the app write data to the shared group user defaults and then have the extension create a JSON file for it to load
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download