Support for `world: "MAIN"` in Safari web extension content scripts

Google has been adding support for running content scripts in world: "MAIN" via either registerContentScripts or since Chrome 111 directly on content_scripts in the manifest.

Safari just added registerContentScripts but doesn't support MAIN. Is there a support roadmap for this sort of thing documented somewhere for Safari? A "wontfix" is far more useful than not knowing whether it will be implemented or not in the foreseeable future...

There may be some other way to achieve this but I am just getting started with Apple-specific development, and am finding navigating the docs very difficult, so apologies if this or some other way to achieve what this enables is documented somewhere!

Answered by Frameworks Engineer in 751935022

Safari 16.4 does support "MAIN" for registerContentScripts.

Accepted Answer

Safari 16.4 does support "MAIN" for registerContentScripts.

Um, so https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/scripting/RegisteredContentScript is wrong? From my testing it doesn't appear to be wrong... Maybe there are cases when it does work for Chrome but doesn't work for Safari? Maybe it only works on iOS (I only tested on the desktop so far...)?

Support for `world: "MAIN"` in Safari web extension content scripts
 
 
Q