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?
Mi piacerebbe vederlo funzionare su Chrome OS. Discourse è già una PWA, quindi le stelle si stanno allineando.
Mi piacerebbe anche poter condividere contenuti SU Discourse. Ad esempio, se selezionassi un’immagine da condividere su Discourse, verrebbe creato un nuovo argomento con l’immagine inserita in cima. Il titolo dell’immagine verrebbe poi utilizzato come titolo dell’argomento.
So anche che molte persone usano Windows, quindi il supporto per quella piattaforma sarebbe ottimo. Vogliono utilizzare il menu nativo. Sembra molto pulito.
Lo stesso vale per macOS, anche se non sono sicuro di come funzionerebbe l’implementazione.
TL;DR: Voglio poter condividere file SU Discourse su tutti i principali sistemi operativi (sia mobili che desktop). Inoltre, vorrei poter condividere link DA Discourse su tutti i principali sistemi operativi desktop. ![]()
Inoltre, Firefox e Safari supportano la Web Share API? Inizialmente pensavo che fosse supportata solo nei browser Chromium.
Questo funziona già da Condividi su Discourse (tramite Android).
Al momento implementiamo solo la versione V1 dell’API, quindi solo testo. L’API di destinazione per la condivisione V2 consente il caricamento di file, ma è un po’ più complessa da implementare. pr-welcome.
È ancora troppo presto per abilitare questa funzionalità su dispositivi non mobili. Ecco alcuni esempi:
- Non funzionerà su Chrome se non stai utilizzando Windows o Chrome OS.
- Non funzionerà su Edge a meno che tu non stia utilizzando Windows.
- Non funzionerà su Firefox, indipendentemente dal sistema operativo che usi.
"web share" | Can I use... Support tables for HTML5, CSS3, etc
Non vedo queste problematiche risolversi a breve.
Perché non usare la scheda di condivisione nativa di Discourse come fallback se un browser non supporta la Web Share API?
Ah, e la Web Share API è ancora rotta su iOS 14. ![]()




