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

The Navigator.canShare() method of the Web Share API returns true if a call to navigator.share() would succeed.


const canShare = navigator.canShare(data);


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().


if(navigator.canShare(data)) {
  // We can use share() to share the data! Woop!


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
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 Full support 75Firefox Android No support NoOpera Android No support NoSafari iOS No support NoSamsung Internet Android Full support 11.0


Full support  
Full support
No support  
No support

See Also