Skip to content

Add that an empty string refers to the current page URL in Share API - #44741

Merged
chrisdavidmills merged 2 commits into
mdn:mainfrom
amirparsadd:patch-1
Jul 16, 2026
Merged

Add that an empty string refers to the current page URL in Share API#44741
chrisdavidmills merged 2 commits into
mdn:mainfrom
amirparsadd:patch-1

Conversation

@amirparsadd

@amirparsadd amirparsadd commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

…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 specification

Motivation

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

@amirparsadd
amirparsadd requested a review from a team as a code owner July 16, 2026 14:46
@amirparsadd
amirparsadd requested review from chrisdavidmills and removed request for a team July 16, 2026 14:46
@github-actions github-actions Bot added Content:WebAPI Web API docs size/xs [PR only] 0-5 LoC changed labels Jul 16, 2026

@chrisdavidmills chrisdavidmills left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @amirparsadd. I've improved the wording, and this looks good to go.

@github-actions

Copy link
Copy Markdown
Contributor

Preview URLs (1 page)

@chrisdavidmills
chrisdavidmills merged commit 20ab148 into mdn:main Jul 16, 2026
9 checks passed
rainbowabul-gif

This comment was marked as spam.

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:WebAPI Web API docs size/xs [PR only] 0-5 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants