Post

Replies

Boosts

Views

Activity

Google registerContentScripts sample doesn't work with Safari 16.4.*
The Safari 16.4.* release docs appear to suggest that Safari now supports registerContentScripts. However, though it no longer throws a method not found error, the actual function doesn't appear to do anything in any of my tests, in either 16.4.0 or now 16.4.1. https://github.com/GoogleChrome/chrome-extensions-samples/scripting Has an example that shows an alert when a script is registered using registerContentScripts. If you run xcrun safari-web-extension-converter scripting/ On the directory it successfully creates a Safari extension project that works for everything except the registerContentScripts call (after adding icons!). It just silently does nothing, with no log or error, whereas everything else works the same as in Chrome. Is anything available on the web anywhere that someone has seen actually working in a real browser? If not I will try and submit a bug report but if I'm just holding it wrong...
2
0
623
May ’23
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!
2
0
769
Apr ’23