From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/zh-cn/web/api/navigator/canshare/index.html | 52 +++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 files/zh-cn/web/api/navigator/canshare/index.html (limited to 'files/zh-cn/web/api/navigator/canshare') diff --git a/files/zh-cn/web/api/navigator/canshare/index.html b/files/zh-cn/web/api/navigator/canshare/index.html new file mode 100644 index 0000000000..9fe117805d --- /dev/null +++ b/files/zh-cn/web/api/navigator/canshare/index.html @@ -0,0 +1,52 @@ +--- +title: Navigator.canShare +slug: Web/API/Navigator/canShare +translation_of: Web/API/Navigator/canShare +--- +
{{APIRef("HTML DOM")}}{{SeeCompatTable}}{{securecontext_header}}
+ +
+ +
如果对Navigator.share() 的调用成功,则Web Share API的Navigator.canShare()方法将返回true。
+ +

语法

+ +
var canShare = navigator.canShare(data);
+ +

参数

+ +
+
data {{optional_inline}}
+
包含要共享的数据的对象,该对象要与{{domxref("Navigator.share()")}}方法传递的数据相匹配。
+
+ +

返回值

+ +

{{jsxref('Boolean')}}值. {{domxref("Navigator.share()")}}若返回True则表示内容可以被成功分享。

+ +

规范

+ + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('Web Share API 2','#canshare-method','canShare')}}{{Spec2('Web Share API 2')}}Initial definition.
+ +

浏览器兼容性

+ + + +

{{Compat("api.Navigator.canShare")}}

+ +

相关连接

+ +

{{domxref('navigator.share', 'navigator.share()')}}

-- cgit v1.2.3-54-g00ecf