navigator.share() opens the device’s native share sheet for text, URLs, and files. Learn ShareData fields, user-gesture rules, pairing with canShare(), five examples, and try-it labs.
01
Kind
Method
02
Returns
Promise<undefined>
03
Status
Limited (not Baseline)
04
Context
Secure (HTTPS)
05
Needs
User gesture
06
Validate with
canShare()
Fundamentals
Introduction
Instead of building your own “Share to Twitter / WhatsApp / Mail” menu, the Web Share API hands off to the OS share sheet. The user picks a target they already trust.
Call await navigator.share({ title, text, url, files }) from a button click. On success the Promise resolves with undefined. If the user cancels, you usually get AbortError.
💡
No Dep / Exp / Non-standard banner
MDN marks Limited availability and a secure context, but not Deprecated, Experimental, or Non-standard. Validate with canShare() before sharing files.
Share must run from a user click. Try It Yourself buttons open the native sheet on supporting browsers (especially mobile). Desktop support varies — always feature-detect and offer a copy-link fallback.
navigator.share() is part of the Web Share API and is not Baseline. Support is strongest on mobile Chromium and Safari. Many desktop browsers lack a native sheet — always feature-detect and provide a copy-link fallback.
✓ Limited · Not Baseline
Navigator.share()
Promise → open the native OS share sheet for URL / text / files.
LimitedNot Baseline
Google ChromeStrong on Android; desktop varies
Limited
Microsoft EdgeFollow Chromium / Windows share UI
Limited
Apple SafariiOS / macOS Web Share where available
Supported
OperaFollow Chromium where available
Limited
Mozilla FirefoxLimited / platform-dependent — feature-detect
Limited
Internet ExplorerNo Web Share API
Unavailable
share()Limited
Bottom line: Detect share on HTTPS, call it from a button click, validate with canShare for files, treat AbortError as cancel, and fall back to clipboard when needed.
Wrap Up
Conclusion
navigator.share() is the Web Share API way to open a native share sheet. Call it from a user gesture on HTTPS, validate with canShare() when needed, and keep a copy-link fallback for browsers without Web Share.
Limited Web Share API — native sheet for URL, text, and files.
5
Core concepts
🔗01
Opens
native share UI
OS sheet
📊02
Support
Limited
Not Baseline
👋03
Needs
user gesture
+ HTTPS
✅04
Validate
canShare()
Especially files
🚫05
Cancel
AbortError
Normal
❓ Frequently Asked Questions
It opens the device’s native share UI so the user can send title, text, a URL, and/or files to apps like Messages, Mail, or social targets.
No. MDN does not mark it Deprecated, Experimental, or Non-standard. It is Limited availability (not Baseline) and requires a secure context. No status banner is required.
The API requires transient activation (a recent user gesture). Scripts cannot open the share sheet arbitrarily.
canShare(data) returns true if share(data) should succeed. Use it especially before sharing files, then call share from the same click handler.
The Promise is typically rejected with AbortError. Treat cancel as a normal outcome, not a hard failure.
Yes. The Web Share API is a secure-context feature (HTTPS or localhost) in supporting browsers.
Did you know?
On Windows the Promise may resolve when the share popup opens, while on Android it often resolves after data is handed to the chosen target. Always design UX around success / cancel rather than assuming identical timing.