Does anyone know how you really update the blockerList.json file for safari content blocker?

Apple provided us with an API for updating the json used for safari content blockers (SFContentBlockerManager.reloadContentBlockerWithIdentifier), so it is clear that Apple intends to make the locked items customizable.

I have been talking with him for a long time, and I can’t understand how you really will do it.

I tried different json files to upload to the extension (one for ads, one for sites, etc.), but sending to more than one file always just aborts the extension for me.

I also tried editing the blockerList.json file from the application, but it seemed to also violate the extension. I was also told that we are not allowed to edit the resource associated with our application.

The documentation for changing which content is blocked seems to be non-existent. Does anyone have an example or at least a link to some documentation that I could use?

thanks

+4
source share
1 answer

. jsons , (, ..) json , json json APP

[[NSFileManager defaultManager] containerURLForSecurityApplicationGroupIdentifier:YOUR_APP_GROUP_IDENTIFIER] URLByAppendingPathComponent:@"SharedJsonFile.json"]

begin beginquestWithExtensionContext, json

NSURL *jsonPath = [[NSFileManager defaultManager] containerURLForSecurityApplicationGroupIdentifier:YOUR_APP_GROUP_IDENTIFIER] URLByAppendingPathComponent:@"SharedJsonFile.json"]; 

, , SharedJsonFile.json, , (SFContentBlockerManager.reloadContentBlockerWithIdentifier).

+3

Source: https://habr.com/ru/post/1610219/


All Articles