Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish Safari Extensions as a Safari App Extensions #664

Closed
heubergen opened this issue Jul 6, 2018 · 172 comments
Closed

Publish Safari Extensions as a Safari App Extensions #664

heubergen opened this issue Jul 6, 2018 · 172 comments

Comments

@heubergen
Copy link

Apple came up with a new idea to integrate Extensions in Safari; https://developer.apple.com/documentation/safariservices/safari_app_extensions

Currently the old technique is only deprecated but in Safari Technology Preview it already started to not work anymore at all (meaning extensions doesn't work even if you upgrade from a older version where the extensions was installed)

@kspearrin
Copy link
Member

Looks like a completely different API https://developer.apple.com/documentation/safariservices/safari_app_extensions/converting_a_safari_extension_to_a_safari_app_extension

Meaning we'd have to write a whole new app just to support Safari :-/

@heubergen
Copy link
Author

I guess it's something you have do check with your usage statistic if it makes sense or not. Obviously as a user I would like to see it.

@bwydoogh
Copy link

@kspearrin Safari Technology Preview 80 was released yesterday (see https://webkit.org/blog/8825/release-notes-for-safari-technology-preview-80/)... and there is the end for the Bitwarden extension 🙁... it is gone and cannot be installed anymore.
Any update on this topic, any plans, ... ?

@kspearrin
Copy link
Member

kspearrin commented Apr 18, 2019

@bwydoogh No sorry, no updates. At this time, I am not sure we will be able to continue supporting Safari in the near future.

  1. Apple has introduced a completely new way of writing extensions for Safari. As far as I understand, this means that we cannot use our existing browser extension code any longer. All other browsers use a standard way of writing extensions (called WebExtensions) with web technologies like HTML, JavaScript, CSS. Apple's new way requires re-writing the extension interface and backend using native Swift/Objective-C. I am not versed in these languages.
  2. Safari currently accounts for <2% of our browser extension users. Maintaining a completely different browser extension codebase for that many users isn't feasible.
  3. For someone who is not well versed in the Apple development ecosystem, Apple's documentation and other community resources on writing Safari Extension Apps (the new way) is pretty sparse.

If someone who is knowledgeable with writing Safari Extension Apps, or even better, making an existing WebExtension somehow work with Apple's new API, wants to provide some consulting on how we can bring Bitwarden back to Safari, please let me know.

@mackaaij
Copy link

As a user and somebody who wants to tell other people Bitwarden is available where you need it, I want Bitwarden to survive new versions of Safari as well. So I really hope this will be fixed. Maybe call for help a bit louder (by using other channels you have at your disposal)?

For now, I filed a complaint at Apple as suggested over here:
https://apple.stackexchange.com/questions/337094/safari-12-compatible-versions-of-ad-blockers-fail-to-block-many-ads

I’m not deep into this topic but I suggested Apple to wait with shutting down extensions until they support webextensions to allow developers to work in a common codebase between browsers. I feel this will be a problem for more extensions but also for new extensions to come so I hope they’ll act on it.

@mackaaij
Copy link

In a chat with me on CrowdIn (as I noticed translations were behind), @kspearrin mentioned "Our desktop app for macOS uses Electron with JavaScript, HTML, and CSS. It isn't a native codebase with Swift/Obj-C like these new Safari Extension Apps require." I found this on Stackoverflow, hopefully it's similar enough or gives handles to move this topic forward: https://stackoverflow.com/questions/45612515/how-to-embed-a-mac-app-extension-in-an-electron-app

@elb101
Copy link

elb101 commented Jun 25, 2019

Safari version in Catalina beta no longer supports Bitwarden. Recommend that Safari support is officially depreciated and official announcement made.

@t-rothe
Copy link

t-rothe commented Jul 6, 2019

Yeah, as far as I know Bitwarden just works fine in other browsers on Catalina so may be not worth the work. Still, how big of a thing is this extension in Electron by now? I just found https://blog.yimingliu.com/2018/11/14/notes-on-porting-a-safari-extension-to-a-safari-app-extension/ which I think is the only way:

Do I really have to port all my global.js / background.js Javascript code to Swift / Objective-C?

The idea is that we embed a WKWebview instance inside the app extension, and have that WKWebview view act as a bridge between the old global.js and the new content script. The WKWebview loads the old global.html file, and shuttles calls from the injected script to the JS inside itself using evaluateJavascript, and then dispatches the evaluated results back to the content script.

For a trivial example, this approach seems to work — though I have not tested it extensively. I imagine for complex use cases though, the time spent re-building global.js to work inside a WKWebview is about the same (or more) than just rewriting it in Objective-C or Swift.

The implementation with Electron should work similar, although maybe in the end maintaining the extension alongside the other platforms/browsers may be more extensive then this.

@halostatue
Copy link

If Bitwarden doesn’t retain Safari integration, then it’s useless to people who use Safari and can’t be recommended as alternatives to LastPass or 1Password. Some people use Safari because it’s not controlled by an advertising company (unlike Chrome) and because it respects their battery (unlike Firefox). I will be withdrawing recommendations of Bitwarden as a lower-cost alternative to 1Password and LastPass unless this is fixed. I’m not expecting the Bitwarden to take action because of my comment (I’m not currently spending any money with Bitwarden, and the amount of money my company would have spent on Bitwarden is relatively small), but it should be clear that for some people, the lack of Safari support is a lack of support period.

@mackaaij
Copy link

I am about to recommend Bitwarden over LastPass in a book :) Would appreciate serious reconsideration as it looks like there is new information about this issue. Safari is the default webbrowser in macOS and besides the reasons mentioned above it is hard for regular users to switch webbrowser.

LastPass isn’t working nicely with Safari for me either, its menu is drawn partly off the screen (I reported this of course but they’re not acting on it). This fact, and the fact LastPass is more cumbersome and worse in support makes me still prefer Bitwarden over LastPass at the moment.

@elb101
Copy link

elb101 commented Jul 12, 2019

I just switched to 1password. Moved into the Apple ecosystem in effort to attain more privacy. iCloud Keychain wasn't cutting it for me, and I was about to move into Bitwarden before this happened.

@kspearrin Please remove Safari from supported platforms on the Bitwarden website until you decide for sure that you'll support it. It is misleading.

@t-rothe
Copy link

t-rothe commented Jul 12, 2019

@otherbrito Safari is still supported by Bitwarden on MacOS 10.14 and older. In addition, Catalina e.g. MacOS 10.15 is just going to be released this fall. So in short: nothing misleading. Especially for those, who do not want to upgrade or who can not upgrade.

@elb101
Copy link

elb101 commented Jul 12, 2019

I wouldn't call that quite "nothing misleading" unless the caveat of "those who do not want to or can not upgrade" is clearly communicated before download.

Those who do not upgrade their systems (and I speak purely those who can no longer receive security updates, but can absolutely upgrade to a newer system that can) are like the antivaxxers of personal computing, in opinion.

@t-rothe
Copy link

t-rothe commented Jul 12, 2019

Right, ok, anyway, let’s get back to the technical discussion here on github. Has any bitwarden engineer looked into this (and the above) more closely in the meanwhile? Last thing we heard was end of April, any news on this side?

@kspearrin
Copy link
Member

We are not removing Safari from our website. Nothing has been finalized about our continued support of Safari. As I mentioned in my previous post, I was hoping someone would reach out to me that could consult on how we can make Bitwarden work under the new App Extension model. Someone has, and I have been working with them on the feasibility of such. Additional updates will be provided in this thread as they become available.

@Crocmagnon
Copy link
Contributor

That's great news! Thanks for sharing that with us 😄

@OneOkami
Copy link

OneOkami commented Jul 15, 2019

I'm currently trialing a switch to Bitwarden from Lastpass and just wanted to chime in and express my appreciation for at least trying to work with the community to find a way to continue supporting Bitwarden in Safari.

The two primary reasons for me being inclined to switch are that you have at least a decent native Windows vault app from what I've experienced so far (Lastpass has practically abandoned support for theirs and I don't wanna touch it with a 10-foot poll) and Bitwarden is open source making it more auditable. I do have and use a MacBook in addition to my Windows machine and I'm strongly inclined to use Safari right now because of its relatively significant power efficiency and if I do make the full-on switch to Bitwarden it would benefit me to have a fully functional extension for Safari.

That being said, I'm one who is generally strongly in favor of supporting and promoting cross-platform standards so I also sympathize if you ultimately decide the special porting hurdles are not worth it and deprecate Safari support. For me Chromium and Firefox are not preferred on my MacBook for battery life reasons but it's also not the end of the world if that's what I have to end up using for consistent and reliable Bitwarden extension support.

@KarimGeiger
Copy link
Contributor

Hey, I don’t want to sound rude or anything, but I’d love to hear if there’s any (rough) timeline of when the extension will be available for Safari? A rough number like a few weeks or months would be sufficient for me.

Additionally, if you guys need a beta tester, I’d be happy to help.

Thanks for working on it!

@t-rothe
Copy link

t-rothe commented Aug 10, 2019

Hey, I don’t want to sound rude or anything, but I’d love to hear if there’s any (rough) timeline of when the extension will be available for Safari? A rough number like a few weeks or months would be sufficient for me.

Additionally, if you guys need a beta tester, I’d be happy to help.

Thanks for working on it!

Right, as you may have noticed here, it is quite unclear if it may return to MacOS 10.15 and higher in any way. So if it does, you may expect this to be on a longer term roadmap. As I understand the current developers correctly, there is currently more need for someone experienced in conversion or overwriting code to a system extension. Which all comes along with maintaining it separately, which may not be worth it.
Workaround as mentioned earlier is the use of Firefox or chrome for now.

Just as a clearification for myself to one of the developers: This problem is not only persisting in the safari extension, but also in the MacOS Main application , right? As it occurs to me at least.

@cofatoeu
Copy link

cofatoeu commented Aug 11, 2019

This problem is not only persisting in the safari extension, but also in the MacOS Main application , right? As it occurs to me at least.

I didn't notice any problems with the main app.

@Crocmagnon
Copy link
Contributor

The macOS desktop app shouldn't have any issue. Apple only changed its policies about Safari extensions.

@kspearrin
Copy link
Member

kspearrin commented Aug 16, 2019

An update here:

I have been successful in porting (read: hacking) the existing Bitwarden web extension into Safari's new app extensions model. I am about 80% of the way there, but I see no reason why we can't have this functioning (albeit with some quirks) for the most part here in the next couple of weeks.

One thing that I still haven't decided on: Should we bundle distribution of the browser extension into the desktop app or should we distribute it separately on its own?

@kspearrin kspearrin reopened this Aug 16, 2019
@KarimGeiger
Copy link
Contributor

Awesome to hear! Let me know if you need a beta tester.

I personally don’t mind whether it’s its own package or bundled. I probably would go for the bundled version, but that’s just me.

@jmauss
Copy link

jmauss commented Aug 17, 2019

I would also love to help test, thanks for all the hard work!

As for bundled vs separate, would you still offer just the extension in the Apple App Store? I think most users probably use just the browser extension (feel free to correct me if I'm wrong), and I would personally prefer to be able to download just one and/or the other.

@pavankjadda
Copy link

Appreciate the work. I would be happy to be part of the bets test.

@arvicrivera
Copy link

arvicrivera commented Sep 30, 2019 via email

@perarg
Copy link

perarg commented Sep 30, 2019

@kspearrin It crashes on launch in High Sierra. I removed the beta-4 and tried to install it through Safari Gallery Extensions. In ~/Library/Logs/DiagnosticReports are created 8 files (.crash). I don't know what files are useful to upload for checking this out.

@jimwins
Copy link

jimwins commented Sep 30, 2019

The desktop app still crashes immediately on startup for me on the version installed from the Mac App store. (This is on Mac OS X 10.11.6 with Safari 11.1.2.)
crash-report.txt

@austin1howard
Copy link

I'm also getting a crash of the desktop app on startup with the app store version. MacOS 10.13.6 (HS).
crash_report.txt

Also, with the app store version, I'm having the Safari extension problem where it logs me out frequently, and the first tab just spins.

@austin1howard
Copy link

With the latest version from the website (1.16.6) the desktop app loads but the safari extension is still having those problems. Something odd I noticed...when I first launch Safari and log in, the prompt says "Logged in as @ on ". Whenever it pops back up to log in again though (after refreshing/loading a new page, often) it says "Logged in as @ on bitwarden.com". Not sure if that's simply a display problem or if it's trying to authenticate with the cloud bitwarden.com for some calls.

@Zegorax
Copy link

Zegorax commented Oct 4, 2019

With the latest update (1.16.7) on the AppStore, the Safari extension became slow when trying to invoke it. When clicking on the Bitwarden icon, it takes 1-2 seconds to open it, which is annoying.
Any idea why it happened ?

@perarg
Copy link

perarg commented Oct 5, 2019

1.16.7 version still not working in High Sierra with Safari 13

@BobWs
Copy link

BobWs commented Oct 5, 2019

1.16.6 is working with safari 13 on high Sierra for me but the desktop app is extremely slow. I have huge lag before it opens.

@perarg
Copy link

perarg commented Oct 6, 2019

Removing previous version = Transfer Bitwarden.app into Trash and empty trash. Should i remove preferences or other files from library folder ?

I am now in Bitwarden-1.16.3-beta4 that it works in Safari, but without the ability to add or refresh any new or existing password. After "removing" this from the Applications and Install the version from AppStore, the Bitwarden.app doesn't start at all.

@jlhopes
Copy link

jlhopes commented Oct 9, 2019

I use the Safari extension on Safari 13.0.1, running on High Sierra, and I currently have Bitwarden 1.16.6 installed (from the website). The Safari extension works but it keeps logging me out every few minutes, even though it's set to lock only on restart.

@kspearrin
Copy link
Member

kspearrin commented Oct 9, 2019

Closing this issue since Safari support is now included in the Bitwarden desktop app.

Please open new issues if you discover something.

@tckb
Copy link

tckb commented Oct 29, 2019

hi @kspearrin the extension fails to login with the following error on safari.

image

Safari: Version 13.0.2 (15608.2.30.1.1)
Mac OS: ver 10.15

Is this expected?

@Zegorax
Copy link

Zegorax commented Oct 29, 2019

@tckb You need to add the following directive in your Apache configuration (in the case of a reverse-proxy to your self-hosted Bitwarden instance)

Header set Access-Control-Allow-Methods "POST, GET, OPTIONS, DELETE, PUT"

@tckb
Copy link

tckb commented Oct 29, 2019

@Zegorax interestingly it works with all the other browser extensions.

@micheldorsey
Copy link

I have installed BitWarden from the Apple App Store, but how to get the new extension installed? It didn’t automatically install with the desktop app and I don’t see it listed in the Apple Extension Store. Thanks in advance! Hoping to get this going and drop kick 1Password through the goalposts of life!

@michaelaye
Copy link

Closing this issue since Safari support is now included in the Bitwarden desktop app.

@kspearrin i don't understand what is meant by this. How does this work? I tried right-click on a login field in Safari, but there's no menu for Bitwarden, so what does this exactly mean?

@mackaaij
Copy link

mackaaij commented Nov 5, 2019

Open Safari, use Cmd + comma (,) to open settings, go to Extensions to see if Bitwarden is there and enabled.

I use Cmd + backslash () to fill logins, I'm not sure if there is a context menu.

@micheldorsey
Copy link

Open Safari, use Cmd + comma (,) to open settings, go to Extensions to see if Bitwarden is there and enabled.

I use Cmd + backslash () to fill logins, I'm not sure if there is a context menu.

Yeah, the extension is not there in settings. I just deleted the app and installed from the bitwarden website, opened and logged in. Still nothing in the extensions list.

@Zegorax
Copy link

Zegorax commented Nov 5, 2019

FYI : On a non-US keyboard, the shortcut on Safari to fill a login is CMD + $ (the letter next to à)

@micheldorsey
Copy link

FYI : On a non-US keyboard, the shortcut on Safari to fill a login is CMD + $ (the letter next to à)

Yeah, I’m not getting shortcuts enabled because the extension is not installed. How is the extension installed? Do you have to manually install it or does it automatically install when the desktop app is installed? No one seems to be answering that question. The extension is not installed because I can not see it in the safari extensions list.

@Zegorax
Copy link

Zegorax commented Nov 5, 2019

You simply have to install it via the AppStore by installing the desktop app. After that, Bitwarden will advertise its extension to Safari, therefore allowing you to enable it in Safari's settings.

@micheldorsey
Copy link

You simply have to install it via the AppStore by installing the desktop app. After that, Bitwarden will advertise its extension to Safari, therefore allowing you to enable it in Safari's settings.

I’m running Catalina, does that make a difference? I will try rebooting too. BTW, I downloaded the app from the BitWarden website versus the Apple store, but I assume the BitWarden website to be more up-to-date than the App Store.

@Zegorax
Copy link

Zegorax commented Nov 5, 2019

I am also on Catalina. I would advise you to download the AppStore version.

@micheldorsey
Copy link

I am also on Catalina. I would advise you to download the AppStore version.

Removed app using AppZapper to remove all associated preferences and the reinstalled using App Store version. Still no joy.

F95721E7-F781-4CBB-AB54-AC0C610CF796

@Zegorax
Copy link

Zegorax commented Nov 5, 2019

You are not in the correct settings. You need to open Safari, then go to "Safari" in the menu bar > Preferences > Extensions and check the Bitwarden app.

@micheldorsey
Copy link

You are not in the correct settings. You need to open Safari, then go to "Safari" in the menu bar > Preferences > Extensions and check the Bitwarden app.

Success! This is proving my rustiness in MacOS. Been using my iPad as my main computer for quite some time and needed a bit of re-education.

@mobihunterz
Copy link

Pls check if you existing chrome extension can be converted into Safari extension like this -> https://developer.apple.com/videos/play/wwdc2020/10665/

Hinton pushed a commit that referenced this issue Jun 3, 2022
* Store appId in localStorage

* Save to local as well
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests