Vimium: feature request: Safari support on macOS Big Sur with new Web Extension API

Created on 28 Jun 2020  路  16Comments  路  Source: philc/vimium

with Safari Web Extensions API we should be able to support Safari using the same codebase.

This would be very great since current alternatives on Safari doesn't have feature parity with Vimium.

Links:

https://developer.apple.com/documentation/safariservices/safari_web_extensions
https://developer.apple.com/videos/play/wwdc2020/10665/
https://hacks.mozilla.org/2020/06/welcoming-safari-to-the-webextensions-community/

Most helpful comment

Hi folks! I'm the (sometimes absent) maintainer of Vimari, a Safari port of Vimium. Vimari was forked from the Vimium codebase many years ago and has mostly lagged behind new features in Vimium. I'm very excited by the new Safari Web Extension support, in theory it would let us unify the Vimari codebase with the Vimium one (if desired). I see a few opportunities for collaboration here, depending on what the maintainers of Vimium would like:

  • Add support for Safari Web Extensions to Vimium and have the Vimium devs manage releases outside of the App Store (updates here will be harder)
  • Add support for Safari Web Extensions to Vimium and have the Vimium devs manage releases to the App Store
  • Add support for Safari Web Extensions to Vimium and have the Vimari devs (currently me) manage releases to the App Store. This could be renamed to Vimium if you liked.
  • If you're not interested in Safari support, or want to take a wait-and-see approach, Vimari creates a new fork of the Vimium codebase to build a Safari capable port, contributing patches upstream where possible, and running our own releases through the App Store
  • Vimari branches a new fork from Vimium and just creates our own fresh codebase. This is essentially what was done many years ago and would be my least preferred option.

All 16 comments

It requires an Apple Developer account, which means 99 US dollars every year...

Is there anyway to donate to the Vimium effort to help cover the cost of something like this? The Safari Web Extensions API was probably the WWDC announcement that excited me most, particularly because of the potential of seeing Vimium work.

We have couple of options here:

  1. We can have donations to cover the cost. (GitHub Sponsor etc)
  2. We can sale the app in AppStore to cover to cost. Like (Dark reader)
  3. Deploy with some one's personal account (I'm happy to contribute mine since we need the enroll in Apple Developer Program anyway)
  4. Not distribute to AppStore, and user can either build it with Xcode or create they own distribution method.

My only concern is that Safari's WebExtension API support isn't good enough for vimium

I'm also interested in this. Currently I'm working a bit on Vimari, one of the Safari alternatives out there on my own fork. As I'm running the macOS Big Sur beta I was able to successfully run the Safari Web Extension converter on the Vimium project with the following result:

$ xcrun safari-web-extension-converter ./vimium --project-location ./vimium-xcode
Xcode Project Location: ./vimium-xcode
App Name: Vimium
App Bundle Identifier: com.yourCompany.Vimium
Language: Swift
Is this correct? [yes]: yes
Warning: The following keys in your manifest.json are not supported by your current version of Safari. If these are critical to your extension, you should review your code to see if you need to make changes to support Safari:
        history
        clipboardRead
        match_about_blank
        bookmarks
        sessions
        notifications

Initially the extension could not be run as there was an error in the manifest content_scripts on line 78 where the matches key is defined for content_scripts/file_urls.css.

"matches": ["file:///", "file:///*/"],

I'm not familiar with the codebase for Vimium but I figured that removing a css file from the manifest wasn't going to break the application, if it even worked at all, so I removed this section of the manifest. After this I was able to build and activate the extension in Safari 14.

I did encounter an issue where upon activation Safari crashes due to it not being able to convert something to grayscale (presumably the logo, as all extension logos are grayscale). The icon of Vimium also doesn't show up in Safari after a restart.

Screenshot 2020-07-11 at 19 10 32

Screenshot 2020-07-11 at 19 30 26

However the extension seems to be activated and in this next image you can see all the files loaded by the extension into the page (as would happen for Vimari) after giving the tool permissions to access content on the website.

Screenshot 2020-07-11 at 19 18 31

However sadly none of the functionality of Vimium seems to be working, I'm not seeing any errors in the console (Xcode nor Safari) so it could be that some initial call is not made. If there is an interest in continuing this path to get a working version (perhaps not with all of the functionality) of Vimium in Safari I'd be willing to spend an afternoon with someone more familiar with the Vimium codebase to try and get it to work.

Vimium should own a background page, so the error messages might be in the console of the bg page, instead of the options page.

You were right, I found an error in the background page:

Screenshot 2020-07-11 at 20 50 17

Hi folks! I'm the (sometimes absent) maintainer of Vimari, a Safari port of Vimium. Vimari was forked from the Vimium codebase many years ago and has mostly lagged behind new features in Vimium. I'm very excited by the new Safari Web Extension support, in theory it would let us unify the Vimari codebase with the Vimium one (if desired). I see a few opportunities for collaboration here, depending on what the maintainers of Vimium would like:

  • Add support for Safari Web Extensions to Vimium and have the Vimium devs manage releases outside of the App Store (updates here will be harder)
  • Add support for Safari Web Extensions to Vimium and have the Vimium devs manage releases to the App Store
  • Add support for Safari Web Extensions to Vimium and have the Vimari devs (currently me) manage releases to the App Store. This could be renamed to Vimium if you liked.
  • If you're not interested in Safari support, or want to take a wait-and-see approach, Vimari creates a new fork of the Vimium codebase to build a Safari capable port, contributing patches upstream where possible, and running our own releases through the App Store
  • Vimari branches a new fork from Vimium and just creates our own fresh codebase. This is essentially what was done many years ago and would be my least preferred option.

@danielcompton I'm curious whether the 1st idea is possible or not - is developers allowed to load a dev version of Vimium to Safari without an Apple account?

@danielcompton great to have you! I am very interested in Safari support. Of the options you presented, the second is the goal. I manage releases to the Chrome and Firefox store and can do so to the App store (I have an active developer account).

Where do we begin?

Safari 14 has publicly shipped. Anyone have open issues they need help with to further this effort?

Hi. Wondering if there is any progress on this front.

I use Vimium on Chrome and would love to have it in Safari as well.

Would love to see this, Vimium is the one of the very few reasons I still use Chrome. Would love to switch to Safari and have and have my battery life back.

Hi. I'm wondering if there's any progress on this.

I've been waiting to use vimium on Safari.

I am using Vimari just fine in Safari on macOS Big Sur.

@philc @danielcompton is there any progress/roadmap? can we help in some way?
Love that vimium wants to embrace the merging of vimari 鉂わ笍
I really would like to switch to safari for the sheer speed on there, but without the T (Search through your open tabs) command I'm lost xD

@philc @danielcompton is there any progress/roadmap? can we help in some way?
Love that vimium wants to embrace the merging of vimari 鉂わ笍
I really would like to switch to safari for the sheer speed on there, but without the T (Search through your open tabs) command I'm lost xD

I'm also waiting for the vimium for Safari. For switching open tabs, maybe this Alfred workflow can help: https://github.com/mandrigin/AlfredSwitchWindows

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nick-s-b picture nick-s-b  路  4Comments

Semro picture Semro  路  3Comments

peter099 picture peter099  路  3Comments

kaldown picture kaldown  路  3Comments

finalfantasia picture finalfantasia  路  3Comments