nolanlawson / pinafore

Alternative web client for Mastodon (UNMAINTAINED)
https://pinafore.social
GNU Affero General Public License v3.0
1.02k stars 173 forks source link

Intent share URL #2308

Closed husim0 closed 1 year ago

husim0 commented 1 year ago

Hello, it would be great to have the ability to generate a toot from a URL.

For example, in Mastodon you can do : https://mastodon.social/share?text=Hello%20there to create a toot with "Hello there" content.

But, as far as I know, it's not possible in Pinafore?

It would allow for example to use URL forward app in Android or others extensions in web browsers that allow the same mechanism.

Thank you, Pinafore is really great!

nolanlawson commented 1 year ago

Pinafore already implements the standard Web Share API. If you install it as a PWA in a browser that supports this functionality, then you should be able to share text as well as images (photos) to Pinafore.

Currently though we don't use query params in the URL, but instead set IndexedDB data:

https://github.com/nolanlawson/pinafore/blob/3c32b48e29a29d853f5d1728745774fc0db80d05/src/service-worker.js#L126

I don't understand how the "Url forwarder" app works, but maybe it could support the standard Web Share API?

husim0 commented 1 year ago

Hello, thank you @nolanlawson for your answer.

I don't use Chrome and that's sad than Firefox doesn't properly supports PWA on desktop. So there's no way to share instantly a link on Pinafore without copy/paste.

Actually URL forwarder just open a shared URL used in a replace placeholder. For example if you share on Android https://github.com, URL forwarder would open something as https://mastodon.social/share?text=https://github.com on a webbrowser.

nolanlawson commented 1 year ago

@husim0 Thanks for the clarification. This sounds like a non-standard equivalent of the Web Share API. I think it would be best if Firefox or URL Forwarder supported the standard. Rather than have Pinafore implement a non-standard approach on top of the standard approach, I would prefer to close this issue. Thanks for raising the topic!

yzrsng commented 1 year ago

@husim0 This small userscript will help you. https://greasyfork.org/scripts/459248-intent-share-url-query-string-for-pinafore