An easy implementation of the Web Share API to display a share sheet on any page across compatible devices.
- Title is pulled using
document.title, which means whatever is placed between the<title></title>will be used. - The description is pulled from the
<meta>element the attributename="description". - The URL is pulled from
document.location.href.
If it seems like the code isn't working with the device you are testing on, it is important to keep in mind that devices handle the Web Share API differently.
- Displays the website home URL and the URL of the page being shared.
- Both the title and text field seem to be ignored.
- No image is displayed.
- Displays the text (description) and URL of the page being shared.
- If the text field isn't present, the title is used as a fallback.
- Chrome on Android now displays the title, description, and URL
- untested
- untested