-
Notifications
You must be signed in to change notification settings - Fork 128
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
Add Safari support #454
Comments
I see someone has succeeded in running the converter: https://github.com/edwang09/hypothesis_extension#note-for-safari Some changes were needed in the javascript code, but the built extensions has been working for me (with the safari setting to trust unsigned extensions). Looks like Apple requires a developer account ($100/year) to get the extension distributed through their app store, which is kind of a drag. |
I'm considering switching to Firefox or Brave primarily to use Hypothes.is but I was also wondering about Safari's web extensions converter and might be game to work on it and send a pull request if I get it working and you guys are open to it. |
You can't login when running the built extensions because they've been built using the Chrome extension's OAuth key, which has a redirect URL using the Chrome extension's scheme ( To make this work, you either need to run your own hypothesis server locally with the appropriate redirect URL for your Safari extension, or we need to persuade the Hypothes.is admins to add an official OAuth key for the Safari extension. |
Honestly, between Hypothes.is and SingleFile I finally just switched to Vivaldi, I still vastly prefer the UX of Safari but they seem to be doing everything they possibly can to make it harder to create (and use) extensions with each major release and I'm tired of it. |
I spent some time looking into this again today because I believe this issue has become much more important. With the new support for Safari Web Extensions in iOS Safari, there is now, for the first time, a viable path to using hypothes.is on mobile devices (without copy/paste workarounds unrealistic for continuous use). Unfortunately, the situation is much more complicated than I'd originally thought. The core problem is that Safari Web Extensions do not have a stable URL scheme. In Chrome, extensions vend content from There is a potential solution, but it's substantially more onerous. It relies on the fact that Safari Web Extensions are always distributed with a first-class app—i.e. which would appear on the iOS home screen, or in the macOS At a high level, the plan would be:
A few more complications in the details:
Complications to step 3 I'm not sure of the details of hypothes.is's expiration policies, but OAuth access codes usually expire rapidly, so it will probably be necessary to exchange the auth code for access and refresh tokens (or maybe just a refresh token) in the context of the containing app, and to store those instead of the access code. One last complication: the In all, this represents a fair amount of work—and more than I feel inclined to do at the moment—but it's nice to see that it's at least possible. Happy to chat more with anyone who's feeling inclined to push this along. |
The Hypothesis backend supports both the standard redirect-based method of returning the authorization code to the caller and If there is some pattern that the Safari team recommend for extensions which use OAuth to acquire an access token, then hopefully we could make that work. It sounds like you might know what that should look like? |
Ah, I'm sorry to have misread! Now I see the relevant code in the backend for non- |
I just discovered raindrop.io, which has great Safari integration, so I moved over to that and deleted all my hypothes.is bookmarklets. 🤷♂️ |
Good point about user scripts. I got it kind of 75% working, but ultimately cross-origin restrictions stopped it from loading on a lot of pages. Since I tried this last year, I see there's a dev setting in Safari to disable cross-origin restrictions, so it might work great now. But it might also be a security problem since there's not a way to whitelist on hypothes.is. Dunno. |
Hello,
Apple recently added support for Web Extensions in Safari which probably makes porting Hypothesis from Chrome/Firefox easier than ever before.
Apple also provides a converter tool.
The text was updated successfully, but these errors were encountered: