raucao / webmarks

remoteStorage-enabled bookmarking app
https://webmarks.5apps.com
Other
76 stars 11 forks source link

Implement Web Share target #61

Closed raucao closed 5 years ago

raucao commented 6 years ago

We can implement the new Web Share API to make Webmarks a native sharing target on Android, after registering it as such from Chrome. See e.g. Mastodon's implementation: https://github.com/tootsuite/mastodon/pull/6278

Spec: https://wicg.github.io/web-share-target/

raucao commented 5 years ago

I have added a Web App Manifest including Web Share Target properties, as described in the spec. However, I couldn't get it to work on my Android yet, and I also noticed that my Mastodon PWA isn't available as a share target anymore. So it looks like it may currently not be working at all in either both Chrome and Chrome Canary, or on this Huawei phone. :/

raucao commented 5 years ago

Aha, in Chrome, their arbitrary PWA installability heuristics apply in order to be able to register a share target: https://developers.google.com/web/fundamentals/app-install-banners/#criteria

raucao commented 5 years ago

great-success

It's all a bit messy, but I figured it out, and now you can install Webmarks as a proper PWA on Android, which will add it as a share target. So any other app that allows sharing something is now able to share to Webmarks!

I switched the offline support from AppCache to ServiceWorker on the way. Also works pretty well so far. In fact, in combination with all the other improvements the app is just blazing fast now, no matter how many bookmarks you have.