How to enable background page for Safari app extension?

I'm trying to develop a Safari app extension and want to enable a persistent background page for it. I could find examples of how to enable it for Web extensions using manifest.json, but for App Extension it seems that I need to use Info.plist and I couldn't find any documentation on it. How can I use the background page?

Replies

Safari App Extensions and Safari Web Extensions are two different extension technologies. Safari App Extensions are limited to macOS but Safari Web Extensions are supported on macOS, iOS, iPadOS, and visionOS. Do you want to continue to build a Safari App Extension or do you mean to build a web extension? Persistent background pages are also only available on macOS, but we encourage you to explore using a non-persistent background page or service worker for broader support and better performance.

The documentation for web extensions is available here.

  • @Systems Engineer , thank you for the answer. I'm building it specifically for macOS and I need Safari App Extension, not Safari Web Extension. I checked the documentation you provided before, but I did not find anything to help me with my problem

  • Safari App Extensions don't support the same APIs as web extensions. You can read more about Safari App Extensions, how to inject scripts, and then send messages between web pages and your extension with this documentation.

  • @Systems Engineer, do I understand correctly that it's impossible to have a persistent background page for the App Extension?

Add a Comment