Vimari: Status of getting the extension available on the Safari Extension store

Created on 11 Jul 2018  ·  37Comments  ·  Source: televator-apps/vimari

I just enrolled into the Apple Developer Program and I will be looking into what changes need to happen to the code before sending it in for review.

I'll keep you updated in this issue!


UPDATED
Read the full issue for context.

TODO

  • [ ] Settings
  • [ ] Make it possible to open multiple links in new tabs
  • [ ] Figure out how to distribute extension
  • [ ] What website to open on new tab? Empty string doesn't work so we need something else, ideally the equivalent of about:config in other browsers

Most helpful comment

Hey everyone,

As I mentioned earlier in this issue I've been dealing with some personal issues the last few months, but things are much better now! As a result of me improving my quality of life I'm much more busy with activities away from the computer, so I don't have as much time and energy to devote to open-source. I hope to find the motivational spark to get the settings thing out the door and publish the extension to the App Store soon.

I hope all of you who donated don't feel like you've been cheated in any way. Thank you all for being patient and understanding ❤️

All 37 comments

Read the docs from Apple and they are great. It looks like the code needs to be wrapped in a macOS app, but it doesn't say of which type. I'll be busy for a few days now but will try to squeeze in some of this work.

If someone has experience with this or want to help out, please let me know.

Been messing around with it now for some time, and man.. the docs are killing me. I'm curious how they expect everyone to migrate their Safari Extensions to Safari App Extensions with this poor documentation that doesn't have any examples. It's gonna take a long time before all extensions are migrated :/

Anyway I got something up and running now, I can use the extension, kinda, but I need to understand the different steps of loading the extension before progressing any further. Also I haven't found any support for having settings for the extension which would suck if that was true.

Also I think we can get away with not having the extension on the App Store, but I'm not sure yet. I've read in some forums about it but haven't investigated more closely. That would mean we have instant releases, but with the downside that you have to come here to Github to download it - instead of opening up App Store. Will investigate this more further on.

I've gotten a version working with Safari 12 now. It's a very hacky solution but it works. However, the settings cannot be changed unless you change them in the code.

Follow the progress in my PR #104.

I merged the PR with the App Extension in it. I provided instructions on how to install it. Please, everyone who has upgraded to macOS Mojave, follow the steps and let us know if something is not working for you. I will continue working on the code making it nicer, but for now you'll have the basic functionality of the extension.

Pinging everyone who's been involved in this so far so we can get some feedback on this:
@jad @jaredmichaelwilliams @olivierlefloch @afarrell @weirdfishes @LiYunyang @pcejrowski @lamons @hcgatewood @LeonardCohen @ovisan @jezkline @danielcompton @guyht

Here are the instructions.

Thanks.

I'm on Mojave (18A326h). As I build the projects there is one error:

error: Task failed with exit 1 signal 0 {
/usr/bin/codesign '--force' '--sign' '0CA31562965A44B984D08063E858CC715E0B0B34' '--verbose' '/Users/liyunyang/Library/Developer/Xcode/DerivedData/vimari-gcitcrkzdthheyeahqdfyuuywers/Build/Products/Debug/vimari.app/Contents/Frameworks/libswiftAppKit.dylib'
}

@LiYunyang Did you try any of these two solutions?

After spending some more time on this I'm not certain we'll be able to migrate all the features, not even some basic ones :(. The API is so limited unless you're working with a popover or toolbar. I don't understand why and I'm trying my best at finding information but since this is so new + Apple's awful documentation, there is none. Like opening a new tab is trivial from a popover/toolbar click but impossible otherwise. Apple will kill most of the current extensions with this approach. I will keep trying but can't promise anything.

Thanks @simeg. I've successfully built it with my own developer certificate and it works with Safari 12 on macOS 10.13.6 High Sierra.,

@akrabat I'm glad it is working for you. Were you required to use your own developer certificate to make it work?

Yes. There was an error on build related to the certificates, so I selected mine in the drop-down.

After taking a few days break from this and getting some help I've managed to find some information that I think will make us able to migrate more features than I initially expected! So what's on my radar now:

  • Migrating all the features
  • Making sure it's possible to install the extension without having a developer certificate. If you have tried and failed it would be useful if you could post the error message(s) here, because right now I'm not sure how to fix this

[rant] [I am not the only frustrated developer](https://forums.developer.apple.com/thread/62410), it seems like. I did what the Apple staff person recommended, I filed a Bug Report where I for ask for an API with more functionality. It's grasping for straws but I don't know what else to do.. Hopefully Apple will realise that they are killing the extension ecosystem for Safari and change the API and write better documentation. [/rant]

Here are the features that are specified in the README:

f Toggle links
F Toggle links (open link in new tab)
k Scroll up
j Scroll down
h Scroll left
l Scroll right
u Scroll up half page
d Scroll down half page
g g Go to top of page
G Go to bottom of page

H History back
L History forward
r Reload
w Next tab
q Previous tab
x Close current tab and go to left tab
X Close current tab and go to right tab
t Open new tab (This one doesn't even seem to be working in version 1.12)

The lines with strikethrough will not work in Safari App Extensions with the current API, which sucks. Also I need to figure out how to manage settings. I'm pretty sure it can be done but it might take some time. However now that this work has been done I can focus on making vimari available for everyone, both via download and also in the future in the App Extension Store.

I'm sorry that many of you donated money towards getting 100% of the functionality available in Safari 12, but there's nothing I can do to change the API :( I hope you understand, and I am still dedicated to making this extension better.

FWiW, The ones available are the key ones for me. Though I couldn't get F to work and had to remap it to t.

@akrabat Everything is not merged into master yet, so that is expected.

Thanks @simeg! It is working on my Mojave machine. (Surprisingly I did not make any change to my previous settings, it just works itself out.)

@LiYunyang I'm glad to hear it's working for you! Did you have to sign it with your developer account? Also, I have a PR open with some more features implemented that I haven't merged into master yet so if you check back in a few days you'll get more features. Like open link in new tab (shift + t) or open new empty tab (t). There are some minor problems related to them but I'm working on it.

@simeg I signed in with my apple ID (which is not a registered developer account) in the first time.

I just merged my branch I've been working on into master which will enable two new features: open link in new tab (shift + t) and open new empty tab (t). It has a toolbar which doesn't do anything right now, I'm trying to figure out how to do settings so just ignore it for now.

So, it appears that one has to change the signing account in Xcode to compile - signing in with your Apple account in xcode and using that seems to work just fine.
When it comes to switching or closing tabs: @simeg is right - there is no support for that in the API right now and unless Apple adds it, I don't thing there is anything to do. Apple allows App extensions to access active tab, but doesn't allow to close it. They also don't allow access to all open tabs. The API is literally useless and I have no idea why would Apple decided to do something like this. With this API, you can open tab, go to url, overlay active page with some new graphical elements, but that's about it

@Rahlir Yeah, I still have some minor issues like that to figure out. Not sure how to do it. I will publish this to the official app extension soon and hopefully that will get rid of those kind of issues. I am also confused to why Apple would do something like this. I think it will seriously lower the usage of Safari.

What I'm trying to figure out right now is settings. I can't find any info on what the recommended way is so I'm trying to see what other people did by looking at their code, but I'm progressing slowly. Will keep you updated.

What I'm trying to figure out right now is settings. I can't find any info on what the recommended way is so I'm trying to see what other people did by looking at their code, but I'm progressing slowly. Will keep you updated.

If you are talking about storing settings in your native Swift code the recommended way would be UserDefaults.

https://www.hackingwithswift.com/read/12/2/reading-and-writing-basics-userdefaults

Obviously you'll have to have your saving/loading logic in Swift and then pass it down to your JS with an event. (something like "getSettings" "saveSettings" probably)

It's absolutely insane how much functionality they removed from extensions. If they actually want good extensions they will have to implement the WebExtensions standard otherwise barely anyone is going to convert/support their extensions for Safari.

If you have any questions about Safari App Extensions that you can't find documentation on feel free to ping me, I've been neck deep in these extensions for about 6 months now hating Apple every second of it.


A note about missing tab functionality though, you can use a super hacky way to interact with tabs:

Apple Script.

In your Swift code you can run an AppleScript script that will interact with the tabs for you. An example of a script that can change the current tab:

tell front window of application "Safari"
    set current tab to tab ((get index of current tab) + 1)
end tell

tell front window of application "Safari"
        close current tab
end tell

First tell will open/activate the tab to the right of the current tab. Second tell will close the currently open tab. So you can create AppleScript functions for "next/previous tab" and "close current go to left/right". You will just have to figure out how to write the AppleScript to do what you want.

The problem with this is I'm pretty sure calling AppleScript scripts will break the app sandbox meaning you can't submit it to the App Extension Store. So you would be stuck with distributing it yourself. (Still has to be signed)

To be fair I haven't actually tested this tab method, but in the past I have tested running AppleScript from a Swift Safari Extension and using it to do stuff in Safari. But haven't released anything using it yet.

EDIT:

I kinda started to doubt my self so I went ahead and made a proof of concept using the current version in this repository: https://streamable.com/kions

This uses my above AppleScript to change tabs. The code is using NSAppleScript and the app sandbox does not have to be disabled.

But you have to add a "Temporary Exception Entitlement" to your entitlements file.

<key>com.apple.security.temporary-exception.apple-events</key>
<string>com.apple.Safari</string>

Documentation: https://developer.apple.com/library/archive/documentation/Miscellaneous/Reference/EntitlementKeyReference/Chapters/AppSandboxTemporaryExceptionEntitlements.html#//apple_ref/doc/uid/TP40011195-CH5-SW3

I'm not sure how that affects getting approved for the App Extension Store.

Seems to be that if you have a valid reason and Apple agrees it'll be approved: https://stackoverflow.com/a/13903333/7768060

@jdf221 Wow, you don't know how much I appreciate having someone to ask questions to - I really appreciate that. I wish I had the energy to work more on this at the moment. I'm facing some tough things in my personal life at the moment, but hopefully I'll find some motivation to get back on this project. I appreciate everyone's patience.

I just wanted to pop in and say that it would be amazing if it was on the app store.

I just spent a long time trying to get it to compile before succeeding thanks to this: https://stackoverflow.com/questions/39754341/none-of-your-accounts-are-a-member-code-signing-errors-after-upgrading-to-xcode

It was painful

Hey everyone,

As I mentioned earlier in this issue I've been dealing with some personal issues the last few months, but things are much better now! As a result of me improving my quality of life I'm much more busy with activities away from the computer, so I don't have as much time and energy to devote to open-source. I hope to find the motivational spark to get the settings thing out the door and publish the extension to the App Store soon.

I hope all of you who donated don't feel like you've been cheated in any way. Thank you all for being patient and understanding ❤️

@simeg can we convince you to share the publishing rights/open up the Developer Team a bit? I'm registered as an Apple Developer and I'd love to get this published and continue to help.

Hey folks, I spent some time this morning getting this to work and it has been submitted for verification. If all goes well, I expect that we'll see Vimari on the Mac App Store within a few days. I made a custom fork, incorporated a recent PR that includes a nice icon, etc.

BUT, I wanted to call out that there's another solution out there that already exists on the app store and seems to be WAY better maintained. Please check out sVim: https://github.com/flipxfx/sVim

If you just want to use a thing that works like Vimium without having to build it yourself, which is what I feel like is what 95% of people want, just download it from the Mac App Store here: https://safari-extensions.apple.com/details/?id=com.flipxfx.svim-6Q2K7JYUZ6

If you want Vimari, hopefully we'll see it on the App Store soon.

This got rejected from the App Store for the following reasons:

  1. Doesn't work with MacOS's Dark Mode.
  2. There is no content in the Window Menu of the extension – this is definitely real.

If anyone is very committed to Vimari, we'd need to fix these things before re-submitting if we had any hope of getting into the App Store to make it easier to download. But I'd strongly suggest checking out sVim, which is mentioned in my comment above as well: https://safari-extensions.apple.com/details/?id=com.flipxfx.svim-6Q2K7JYUZ6

@nchase, won’t that suffer the same fate as this extension with the next release of macOS? Isn’t the Safari Extension store going away, and the only way to get extensions is bundled in apps?

Ah. For some reason I thought it was already in the mac app store, sorry about that.

sVim seems a bit better maintained (someone is actively merging pull requests there as recently as a few months ago and the extension doesn't have either of the problems that got me rejected when I submitted Vimari, so it seems like the lift would be smaller to get it where it needs to be, but I could be wrong).

Haven't looked into the code at all, really.

@danielcompton Do you have any interest in being a champion of Vimari? (If you did, I could just push the changes I've made so far to my remote and you can pick up there.)

Yep I have thought about this and am running my own build locally which has merged a few PRs. I’d be happy to try and get this onto the store. I’ve also thought it would be good long term to get the Safari build based more closely on the upstream project so we can take advantage of (and contribute to) improvements in the original code base.

Awesome 😄

Do you have any perspective on sVim vs Vimari? (i.e. have you dug deep enough to have an opinion on the code and architecture of each?)

I wasn't aware of sVim until you mentioned it, but it also derives from a Chrome plugin: cVim which has ~30k users. Vimari derives from Vimium which has ~300k users. I use Vimium in Chrome too.

cVim explains some differences though those are five years old and Vimium may have some or all of them now. None of the listed features have been that important for me, although I could see why people might want them.

I can't really make any more informed comparisons of them right now, what are your thoughts?

I use Vimium in Chrome too, which is how I found Vimari :)

Depending on how easy it is to port features from Vimium, I'd say that's still my first choice since it's so vibrant and active.

A few years ago I was able to write up a pull request that got merged into Vimium without a lot of work (i.e. the code was pretty clear and easy to comprehend and alter, and glancing at Vimium again it still seems to be pretty small and comprehensible – I guess it's written in coffeescript which is a minor barrier but worth mentioning).

At a distance it seems like it shouldn't be horrendous to port features/maintain parity 🤷‍♂️

I think the real work is going to be getting this project ready for the App Store. I was able to spend 90 minutes on that last week and made it further than expected, but didn't anticipate the issues that we got rejected for.

Hey everyone,

In January 2018 I committed to putting this extension on the App Store and people donated money towards that goal. I want to apologize to those of you who donated; I honestly thought I had the energy and perseverance to make it so but things happened that made my focus turn elsewhere. As I've mentioned before I had some upsets in my personal life that made me prioritising feeling OK again over anything else. I'm now feeling OK again 🙂 and if anyone wants their money back I will gladly return it. E-mail me at [_removed because no action for some time_] for a refund! I feel bad for not completing what I promised and I don't want anyone to feel duped.

As for the project goes I will not continue this goal. I'm happy to see other people step up and if I can be of any support let me know. The owner of this project is not active anymore but I might be able to put you in contact with him for access to the repo.

I'm happy to see other people step up and if I can be of any support let me know. The owner of this project is not active anymore but I might be able to put you in contact with him for access to the repo.

Thanks, I've sent an email to Guy about taking over maintenance of this project and getting it into the App Store. I'm hoping to get something in there by Catalina's release date so that upgraders have something to move to.

Hi all,

I plan to transfer Vimari over to @danielcompton . I have opened a separate issue to discuss any last comments before the transfer - please post any comments in #137

Closed in favor of #139.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

manish-makwana picture manish-makwana  ·  7Comments

j0na1han picture j0na1han  ·  3Comments

breyed picture breyed  ·  5Comments

danielcompton picture danielcompton  ·  4Comments

lonelytb picture lonelytb  ·  23Comments