--- title: Navigator.canShare slug: Web/API/Navigator/canShare translation_of: Web/API/Navigator/canShare ---
Navigator.share()
的调用成功,则Web Share API的Navigator.canShare()
方法将返回true。var canShare = navigator.canShare(data);
data
{{optional_inline}}{{jsxref('Boolean')}}值. {{domxref("Navigator.share()")}}若返回True则表示内容可以被成功分享。
Specification | Status | Comment |
---|---|---|
{{SpecName('Web Share API 2','#canshare-method','canShare')}} | {{Spec2('Web Share API 2')}} | Initial definition. |
{{Compat("api.Navigator.canShare")}}
{{domxref('navigator.share', 'navigator.share()')}}