Introducing the Web Share API | Web | Google Developers

We can try switching the topic share icon action to the web share intent on supported platforms ( Chrome android for now)

「いいね!」 19

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:

「いいね!」 16

This only happens on Android yes? Seems fairly safe to me then. @gerhard can you review?

「いいね!」 1

It’s merged and it works great on Chrome 61. :+1:

「いいね!」 8

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?

「いいね!」 11

It’s still there when you tap on the post’s time.

Only the share button uses the new functionality.

「いいね!」 13

It works on iOS 12.2 :tada:

「いいね!」 11

Chrome OS でこれが動作するのを見たいですね。Discourse はすでに PWA なので、まさに好機が到来しています。

また、Discourse へ何かを共有できるようにもなってほしいです。例えば、画像を Discourse に共有すると、その画像が先頭に挿入された新しいトピックが作成され、画像のタイトルがトピックのタイトルとして設定されるような仕組みです。

Windows を利用している人も大勢いるので、そのプラットフォームへの対応も素晴らしいでしょう。彼らはネイティブメニューを使いたいと考えています。非常にクリーンな見た目です。

macOS についても同様ですが、実装方法がどうなるかはあまり確信が持てません。

TL;DR: 主要なすべての OS(モバイルおよびデスクトップの両方)で、ファイルを Discourse へ共有できるようにしたいです。それに加えて、主要なすべてのデスクトップ OS で、Discourse からリンクを共有できるようにもしたいです。:slight_smile:

また、Firefox と Safari は Web Share API をサポートしていますか?当初は Chromium ベースのブラウザでのみサポートされていると思っていたのですが。

これは既に Share to Discourse (via Android) で動作しています。

現時点では API の V1 のみを実装しており、テキストのみに対応しています。V2 の共有ターゲット API ではアップロードが可能ですが、実装は少し複雑です。pr-welcome

「いいね!」 3

まだ非モバイルデバイスでの有効化には早すぎます。いくつかの例を挙げます。

  • Windows または Chrome OS を使用していない場合、Chrome では機能しません。
  • Windows を使用していない場合、Edge では機能しません。
  • どの OS を使用していても、Firefox では機能しません。

これらの問題は、近いうちに修正されるとは思えません。

「いいね!」 6

ブラウザが Web Share API をサポートしていない場合、フォールバックとして Discourse 独自の共有シートを使用するのはどうでしょうか。

それと、Web Share API は iOS 14 でまだ不具合があります。:slightly_frowning_face: