We can try switching the topic share icon action to the web share intent on supported platforms ( Chrome android for now)
AI-generated summary
The Web Share API has been introduced to Discourse, allowing users to share content directly from the platform. Falco created a pull request to implement the API, which has been merged and is working on Chrome Android and iOS 12.2 Falco.
The native share sheet is used, and the “reply as linked topic” button is still accessible by tapping on the post’s time gerhard.
Users have requested support for sharing files to Discourse on all major operating systems, including Windows and macOS anon82467725. However, this would require implementing the V2 share target API, which allows uploads, and is a more complex task Falco.
Enabling the Web Share API on non-mobile devices is not recommended due to compatibility issues with certain browsers and operating systems Johani. Using Discourse’s own share sheet as a fallback for browsers that don’t support the Web Share API has been suggested Justin_Vega.
Ok, did a quick try at this while I was in the plane and after some cleaning up sent a pull request.
Here is it in action:
This only happens on Android yes? Seems fairly safe to me then. @gerhard can you review?
It’s merged and it works great on Chrome 61. ![]()
I don’t have an android device to test, but I’m assuming this means users no longer have access to the “reply as linked topic” button that is normally next to the share buttons?
Can this functionality be put elsewhere? Or is there any way to add a custom button to the native share sheet?
It’s still there when you tap on the post’s time.
Only the share button uses the new functionality.
Gostaria de ver isso funcionando no Chrome OS. O Discourse já é um PWA, então as estrelas estão se alinhando.
TambĂ©m gostaria de poder compartilhar coisas PARA o Discourse. Por exemplo, se eu selecionasse uma imagem para compartilhar com o Discourse, ele criaria um novo tĂłpico com a imagem inserida no topo. O tĂtulo da imagem seria entĂŁo usado como tĂtulo do tĂłpico.
Também conheço muitas pessoas que usam Windows, então o suporte para essa plataforma seria ótimo. Elas querem usar o menu nativo. Ele parece muito limpo.
O mesmo vale para o macOS, embora eu não tenha muita certeza de como a implementação funcionaria.
TL;DR: Quero poder compartilhar arquivos PARA o Discourse em todos os principais sistemas operacionais (tanto móveis quanto desktop). Além disso, gostaria de poder compartilhar links DO Discourse em todos os principais sistemas operacionais desktop. ![]()
Além disso, o Firefox e o Safari suportam a Web Share API? Originalmente, pensei que era suportada apenas em navegadores Chromium.
Isso já funciona desde Compartilhar para o Discourse (via Android).
No momento, implementamos apenas a V1 da API, entĂŁo apenas texto. A API de destino de compartilhamento V2 permite uploads, mas isso Ă© um pouco mais difĂcil de implementar. pr-welcome.
Ainda Ă© muito cedo para ativar isso em dispositivos nĂŁo mĂłveis. Aqui estĂŁo alguns exemplos.
- Não funcionará no Chrome se você não estiver usando Windows ou Chrome OS.
- Não funcionará no Edge, a menos que esteja usando Windows.
- Não funcionará no Firefox, independentemente do sistema operacional que você usa.
"web share" | Can I use... Support tables for HTML5, CSS3, etc
NĂŁo vejo esses problemas sendo resolvidos tĂŁo cedo.
Por que nĂŁo usar o prĂłprio painel de compartilhamento do Discourse como alternativa se o navegador nĂŁo suportar a API Web Share?
Ah, e a API Web Share ainda está com problemas no iOS 14. ![]()




