The navigator.share method of the Web Share API invokes the native sharing mechanism of the device to share data such as text, URLs, or files. The available share targets depend on the device, but might include the clipboard, contacts and email applications, websites, Bluetooth, etc.
navigator.share
The method resolves a Promise with undefined. On Windows this happens when the share popup is launched, while on Android the promise resolves once the data has successfully been passed to the share target.
Promise
undefined
The following is a list of usually shareable file types. However, you should always test with navigator.canShare() if sharing would succeed.
navigator.canShare()
.pdf
application/pdf
.flac
audio/flac
.m4a
audio/x-m4a
.mp3
audio/mpeg
audio/mp3
.oga
audio/ogg
.ogg
.opus
.wav
audio/wav
.weba
audio/webm
.avif
image/avif
.bmp
image/bmp
.gif
image/gif
.ico
image/x-icon
.jfif
image/jpeg
.jpeg
.jpg
.pjp
.pjpeg
.png
image/png
.svg
image/svg+xml
.svgz
.tif
image/tiff
.tiff
.webp
image/webp
.xbm
image/x-xbitmap
.css
text/css
.csv
text/csv
.ehtml
text/html
.htm
.html
.shtm
.shtml
.text
text/plain
.txt
.m4v
video/mp4
.mp4
.mpeg
video/mpeg
.mpg
.ogm
video/ogg
.ogv
.webm
video/webm