You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 attribute name="description".
The URL is pulled from document.location.href.
Not working?
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.
Windows
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.
Android (tested with Google Pixel)
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.
Logic of the code:
document.title
, which means whatever is placed between the<title></title>
will be used.<meta>
element the attributename="description"
.document.location.href
.Not working?
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.
Windows
Android (tested with Google Pixel)
MacOS
iOS