Navigator.canShare

You’re reading the English version of this content since no translation exists yet for this locale. Help us translate this article!

This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

Secure context
This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

The canShare() method of the Navigator interface returns true if a call to Navigator.share() would succeed.

Syntax

var canShare = navigator.canShare(data);

Parameters

data Optional
An object containing data to share that matches what you would pass to Navigator.share().

Return value

A Boolean. True if data can be shared with Navigator.share().

Exceptions

None.

Specifications

Specification Status Comment
Web Share API - Level 2
The definition of 'canShare' in that specification.
Draft Initial definition.

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
canShareChrome No support NoEdge No support NoFirefox No support NoIE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoFirefox Android No support NoOpera Android No support NoSafari iOS No support NoSamsung Internet Android No support No

Legend

No support  
No support

See Also

navigator.share()