linkding icon indicating copy to clipboard operation
linkding copied to clipboard

add support for web-share-target API

Open fs111 opened this issue 3 years ago • 5 comments

The web-share-target API allows websites to be the target of a share action on a mobile phone. This works with chrome on android and would allow users of android to save bookmarks via the native sharing feature of the android platform.

documentation about the web-share API can be found here https://web.dev/web-share-target/

I wanted to explore that a bit, if there is interest in it from the upstream project.

fs111 avatar Mar 22 '21 14:03 fs111

In general I'm OK with that, as it seems like a rather isolated thing that doesn't change much.

Note that this feature requires the website to be installed as a progressive web application first, which opens up a completely different topic. Adding a web manifest, a service worker, correct offline handling such as a offline fallback page etc.

Note that I started using a pretty nice workaround on iOS by using the integrated automation tool, which allows you to define custom workflows as share targets. In short I just configed a share action that opens the the new bookmark form in Safari while appending the shared URL as URL parameter. I'm 99% sure something similar can be achieved on Android using apps like Tasker or similar. Maybe the more pragmatic solution is to figure out a way on how to accomplish this on Android as well, and then document it in this repo so that other users can benefit from it too.

sissbruecker avatar Mar 22 '21 15:03 sissbruecker

Thanks for the reply. I actually found an easier way. Following https://paul.kinlan.me/use-bookmarklets-on-chrome-on-android/ I created a bookmark that can actually use the bookmarklet code.

LMK if you want a PR that adds this as a HOWTO to the README.

fs111 avatar Mar 23 '21 21:03 fs111

@fs111 Sure, that would be cool. 👍 Can also consider opening a new how-to.md file in the docs folder.

sissbruecker avatar Mar 24 '21 15:03 sissbruecker

In my opinion it would be great to add pwa features to the web app. Most people intuitively want to add a url via share menu.

you can also use my shortcut here.

The difference is that it uses the internal linkding api. You can add a url via iOS Share Menue without opening the linkding web application in a safari overlay. There just appears a system popup to add tags.

techducks avatar Oct 06 '22 13:10 techducks

Looks like the share target API still isn't supported in Safari / iOS or Firefox: https://developer.mozilla.org/en-US/docs/Web/Manifest/share_target#browser_compatibility

sissbruecker avatar Oct 06 '22 22:10 sissbruecker

Should be resolved with https://github.com/sissbruecker/linkding/pull/630

sissbruecker avatar Mar 17 '24 08:03 sissbruecker