Navigator.share

This is an experimental technology
Because this technology's specification has not stabilized, check the compatibility table for usage in various browsers. Also note that the syntax and behavior of an experimental technology is subject to change in future versions of browsers as the specification changes.

The Navigator.share() method invokes the native sharing mechanism of the device as part of the Web Share API. If the Web Share API is unsupported, then this method will be undefined.

Syntax

var sharePromise = window.navigator.share(data);

Parameters

data
An object containing data to share. At least one of the following fields must be specified. Available options are:
  • url: A USVString representing a URL to be shared.
  • text: A USVString representing text to be shared.
  • title: A USVString representing the title to be shared.

Examples

navigator.share({
  title: document.title,
  text: 'Hello World',
  url: 'https://developer.mozilla.org',
}); // share the URL of MDN

Specifications

Specification Status Comment
Unknown Unknown Linked to spec is the latest editor's draft; W3C version is a REC.

Browser compatibility

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support No support No support No support No support No support
Feature Android Android Webview Firefox Mobile (Gecko) Firefox OS IE Phone Opera Mobile Safari Mobile Chrome for Android
Basic support No support No support No support No support No support No support No support 61.0

Document Tags and Contributors

 Contributors to this page: samthor
 Last updated by: samthor,