Safari app extension contentBlocker(withIdentifier:blockedResourcesWith:on:) how does it work? how to get it to work?

There is a new API contentBlocker(withIdentifier:blockedResourcesWith:on:) in osx10.15

https://developer.apple.com/documentation/safariservices/sfsafariextensionhandling/3238030-contentblocker


But as with other related updates the documentation is lacking.


Specifically, how does this work and how to get it to work?

Do I need to implement my own content blocker?

If so, then how does the communication between the content blocker and the safari app extension work / what needs to be configured to make that communication work?


Would be nice to have this implemented before the 10.15 actually goes live...

Replies

There isn't any written documentation for this feature yet, but the API is explained in the "What's new in Safari Extensions" 2019 WWDC video.


https://developer.apple.com/videos/play/wwdc2019/720/


There is also a demo of how to adopt and use this API. You will need your own content blocker. Let me know if you have any questions after watching the video.

Thank you for the reply.

One follow up question, the user will then have to enable both the extension and the content blocker for this to function, correct?

That is correct!