Navigator.canShare()

Non-standard
This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future.

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 Navigator.canShare() method of the Web Share API returns true if a call to navigator.share() would succeed.

Syntax

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

Examples

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

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
canShare
ExperimentalNon-standard
Chrome 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

Legend

Full support  
Full support
No support  
No support
Experimental. Expect behavior to change in the future.
Experimental. Expect behavior to change in the future.
Non-standard. Expect poor cross-browser support.
Non-standard. Expect poor cross-browser support.

See Also

navigator.share()