Add that an empty string refers to the current page URL in Share API - #44741
Merged
Conversation
amirparsadd
requested review from
chrisdavidmills
and removed request for
a team
July 16, 2026 14:46
chrisdavidmills
approved these changes
Jul 16, 2026
chrisdavidmills
left a comment
Contributor
There was a problem hiding this comment.
Thanks, @amirparsadd. I've improved the wording, and this looks good to go.
Contributor
|
Preview URLs (1 page) |
estelle
pushed a commit
to estelle/content
that referenced
this pull request
Jul 28, 2026
…dn#44741) * Add that an empty string refers to the current page URL in Share API Docs * improve wording --------- Co-authored-by: Chris Mills <chrisdavidmills@gmail.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…Docs
Description
This PR adds details under the possible values of the data parameter of the navigator.share function inside the url section saying that setting the url to an empty string (
"") refers to the current page. this is based on this specificationMotivation
So I was diving deeper into the API specs and saw this and thought this could be very helpful for developers using this API and would also help MDN to get closer to the spec.
Additional details
https://w3c.github.io/web-share/#sharing-text-and-links:~:text=Note%20that%20a%20url%20of%20%27%27%20refers%20to%20the%20current%20page%20URL%2C%20just%20as%20it%20would%20in%20a%20link.%20Any%20other%20absolute%20or%20relative%20URL%20can%20also%20be%20used.
Related issues and pull requests
Fixes #44741