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 的情况也类似,虽然我还不太确定具体如何实现。

简而言之:我希望能够在所有主流操作系统(包括移动设备和桌面设备)上将文件分享到 Discourse。此外,我还希望能够在所有主流桌面操作系统上从 Discourse 分享链接:slight_smile:

另外,Firefox 和 Safari 是否支持 Web Share API?我原本以为它仅在 Chromium 浏览器中受支持。

这已经可以通过 分享到 Discourse(通过 Android) 实现。

目前我们仅实现了 API 的 V1 版本,因此只支持文本。V2 分享目标 API 支持上传,但实现起来会稍微复杂一些。#pr-welcome。

3 个赞

在非移动设备上启用此功能还为时过早。以下是几个示例:

  • 如果你未使用 Windows 或 Chrome OS,它在 Chrome 上将无法工作。
  • 除非你使用 Windows,否则它在 Edge 上将无法工作。
  • 无论你使用什么操作系统,它在 Firefox 上都无法工作。

我看不到这些问题会在短期内得到修复。

6 个赞

如果浏览器不支持 Web Share API,为何不将 Discourse 自带的分享面板作为备选方案呢?

另外,Web Share API 在 iOS 14 上仍然存在问题。:slightly_frowning_face: