95

Also goes well with this issue as a side dish.

In order to currently import a Safari web extension, I need to:

  1. Go into Finder
  2. Go to my Applications folder
  3. Find the app associated with the extension
  4. Choose "Show Package Contents" in the right-click menu
  5. Go to the "Contents" folder
  6. Go to the "PlugIns" folder
  7. Right-click the .appex file
  8. Choose "Show Package Contents" in the right-click menu
  9. Go to the "Contents" folder
  10. Go to the "Resources" folder
  11. Make sure there's a manifest.json file (validate that this is a web extension and not an app extension)
  12. Get to Orion's extension manager screen
  13. Choose "Add Extension"
  14. Choose "Install from Disk..."
  15. Drag-and-drop the manifest.json file into the pop-up menu
  16. Choose "Open"
  17. Choose "Add"

As you can see, it's kind of difficult to do this, and definitely annoying to do with every extension! It's not frustrating, just tedious. I can't just choose to add the .appex file - much less the .app file. I have to add the folder inside the .appex file. I'd really love for this to be automated instead of the manual mess it is right now; that is, you can choose .app and .appex files from the pop-up menu, and if there is a valid web extension to be found (or more than one in some cases), you can import it/them.

[This issue #6840 was merged into this main issue #6839, so this introductory paragraph looks weird. I (OP) am editing it to make this clearer.]

I've imported a few Safari web extensions following these directions. Particularly, Bitwarden, 1Password for Safari, and Refined GitHub. Bitwarden and Refined GitHub show up as Firefox extensions, while 1Password for Safari shows up as a Chrome extension.

  1. Download one of these three web extensions from the Mac App Store (or seemingly any other web extension)
  2. Go into Finder
  3. Go to the Applications folder
  4. Find the app associated with the extension
  5. Choose "Show Package Contents" in the right-click menu
  6. Go to the "Contents" folder
  7. Go to the "PlugIns" folder
  8. Right-click the .appex file
  9. Choose "Show Package Contents" in the right-click menu
  10. Go to the "Contents" folder
  11. Go to the "Resources" folder
  12. Make sure there's a manifest.json file (validate that this is a web extension and not an app extension)
  13. Get to Orion's extension manager screen
  14. Choose "Add Extension"
  15. Choose "Install from Disk..."
  16. Drag-and-drop the manifest.json file into the pop-up menu
  17. Choose "Open"
  18. Choose "Add"
  19. Observe that it's labeled as a Firefox/Chrome extension in the manager

I expected these extensions to be labeled as a Safari extension.

Version 0.99.126.4.1-beta (WebKit 618.1.2)

Sonoma (14)

    Huh, literally no one in in the discord or any of the orion developers ever knew that you could import certain safari extensions. There was never any plan to make this process easier coz nobody knew about it 😄

    similar to #6839, because nobody ever knew that safari extensions could be imported, orion essentially doesn't know that safari extensions could be installed

    I'm surprised! Well, there you go - enjoy the knowledge 😅

    • gp likes this.

    Of course.
    This is definitely something very interesting that @Vlad would love to hear about.

    Also, a few questions:

    • Do the safari versions seem to work better than the chrome/firefox versions?
    • Can you install certain safari-only extensions with no chrome/ff counterparts? My understanding was that they could be implemented in swift, which isn't compatible with the js-based extension api.
    • What about the extensions require money upfront/have a subscription?

      eirk @Vlad

      To share the questions already asked in the Discord:

      • What are Safari web extensions? From Apple: "A Safari web extension adds custom functionality to Safari using JavaScript APIs and common file formats from extensions for Google Chrome, Mozilla Firefox, and Microsoft Edge browsers. While Safari app extensions are useful for sharing code between your native macOS app and Safari, you build Safari web extensions primarily on JavaScript, HTML, and CSS, and can repackage them to work in other browsers."
      • Does this mean all Safari extensions work? No. Safari app extensions are still proprietary and under lock and key - but funny enough, legacy Safari extensions work the same way as these web extensions do. You can extract the .safariextz file with something like Keka, and then load that folder into Orion.
      • Doesn't Safari has a severe lack of web extension APIs? Yes. Yes. This does not change that.

      To answer the questions asked here:

      • Do the Safari versions seem to work better than the Chrome/Firefox versions? As they're web extensions, they're being interpreted in the same way that a Chrome or Firefox extension would be interpreted by Orion. No difference under the hood. It's up to you and per extension to see whether or not it would work better. (I hear Dark Reader works best in Safari!)
      • What about the extensions that require money upfront / have a subscription? Not sure what this means. Regardless of if you mean a purchase in the Mac App Store before the app is downloaded, or if you mean a purchase made in the browser after the fact, I don't see why that wouldn't work. If you mean a purchase made in the Mac App Store after the app is downloaded, that's likely dependent on the extension.
      Merged 2 posts from Safari web extensions are falsely labeled as being from other browsers.

        Ok so it loks like we can make this work somehow. How would the UX for this look like? Does this connect to "Install from Disk..." option?

        How would users know that they can point out to a safari extension app?

          Merged 9 posts from Making it easier to add Safari web extensions to Orion.
            5 days later

            I think we can just have it be like "Install Safari extension...", which defaults to ~/Applications, and then it would have some extra logic to attempt to extract the normal js extension from it, basically what the Install from Disk... does

              I'm curious how many Safari web extensions work out of the box. The big concern is the native app communication, since that happens over a privileged connection only Safari can provide. My guess is that many multi-browser extensions will be somewhat compatible. But the moment a Safari extension expects an open comms port to its native container app, 🤷‍♂️ . My first test so far (1password) didn't work. The extension installs and loads fine (Orion treats it like a Chrome extension as noted above), but then it can't connect to the desktop 1password app.

              3 months later
              3 months later

              JBMagination This is excellent. Thank you.

              Your process allows the often-asked-about Vinegar extension for Safari to be loaded into Orion with a small caveat: only the 'Vinegar Extract' variant works (as only it has a manifest.json), and subtitles/captions are not functional at all seemingly due to a Javascript error being thrown in the console.
              That is indeed a seperate issue, but perhaps this info will be useful for anyone searching for a way to use Vinegar in Orion as I had been, until Orion implements that feature natively (hopefully soon 🙂).

                Note that for some extensions - e.g. 1password the Safari Extension does not work well on macOS - it can't deal with Safari profiles.

                This is the main reason I am using Orion so that I don't have to use Safari extensions.

                  5 months later

                  Well what do you know - never say never. @dino figured out a way to natively load Safari extensions and it works! Coming to OrionRC soon first.

                  Orion will be the only browser in the world to support extensions from all three major browsers - Chrome, Firefox and Safari.

                  6 days later