coderef

navigator.share()Limited availability

The navigator.share() method invokes the device's native sharing mechanism and passes text, links, files, and other content to share targets. Also known as the Web Share API.

Not yet supported in all major browsers — check the table and provide a fallback.

Browser support

DesktopChrome
1–127Not supported
128+Supportedsince Aug 20, 2024
Current: 155
Edge
12–92Not supported
93+Supportedsince Sep 2, 2021
Current: 154
Firefox
✕Not supportedup to 157
Current: 157
Safari
1–12Not supported
12.1+Supportedsince Mar 25, 2019
Current: 27
MobileChrome Android
18–60Not supported
61+Supportedsince Sep 5, 2017
Current: 155
Firefox Android
4–68Not supported
79+Supportedsince Jul 28, 2020
Current: 157
Safari iOS
1–12Not supported
12.2+Supportedsince Mar 25, 2019
Current: 27

How to use

Not supported in Firefox. Use feature detection below and provide a fallback (or a polyfill) for those browsers.

Example

Full syntax and examples are on MDN: canShare.

Feature detection

JS · check before using
if ("Navigator" in globalThis && "share" in Navigator.prototype) {
  // Navigator.share is available
}

Sub-features

Support for each part of the feature (8). The overall table above shows when the whole feature works.

Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
Navigator.canShare12893✕14759614
Navigator.canShare.data_files_parameter12893✕1476✕14
Navigator.canShare.data_text_parameter12893✕14769614
Navigator.share12893✕12.1617912.2
Navigator.share.data_files_parameter12893✕1476✕14
Navigator.share.data_text_parameter12893✕14767914
iframe.allow.web-share868681✕8681✕
http.headers.Permissions-Policy.web-share8888✕✕88✕✕