Safari 14 now supports WebExtensions, in addition to Safari App Extensions and after killing off Legacy Safari Extensions (.safariextz)
The official guides provided by Apple (a bit buried): https://developer.apple.com/documentation/safariservices/safari_web_extensions
A couple of notes:
- Not every type of extension is possible:
- Safari extensions always run on Private Browsing windows, unlike Chrome and Firefox which disables all extensions on incognito by default
- The user needs to explicitly grant each extension access to a specific website in order for the extension to function, this is something that Chrome is also trying to do but probably quite hard without breaking existing extensions
- The distribution method is similar with Safari App Extensions, the user needs to download a wrapper app that provides the Safari extension inside
- Because of the distribution method mentioned above, packaging a Safari WebExtension won't be as straightforward as zipping the extension unlike Chrome/Firefox as you (most likely) need to face the intricacies of Xcode signing
- Apple's docs doesn't seem to have any mention of self-hosted extensions (unlike safariextz), so it's most likely only available through the Mac App Store
- Apple really doesn't want people to use the development mode 'backdoor' to sideload extensions (or at the very least, make it annoying and painful to do so) by not allowing unsigned extensions by default and discarding the extension every time you relaunch Safari
xcrun safari-web-extension-converter /Users/user/Downloads/ghdnfbmfflgelndafnlgabneckbmfpla
Once the Terminal command is done, Xcode pops up and you can just click the top-left 'play' button to build and run the app.
Safari will launch, then you can open the Safari Extensions window and see that your extension should be inside. If it's not, then you need to enable the Develop menu at Preferences, then enable "Allow Unsigned Extensions".