Skip to content

Clarify behavior of client.url#43844

Open
wbamberg wants to merge 1 commit intomdn:mainfrom
wbamberg:fix-41483
Open

Clarify behavior of client.url#43844
wbamberg wants to merge 1 commit intomdn:mainfrom
wbamberg:fix-41483

Conversation

@wbamberg
Copy link
Copy Markdown
Collaborator

@wbamberg wbamberg commented Apr 17, 2026

Fixes #41483, fixes #41482.

At least that's the idea.

My understanding of this, mostly from testing, is that Client.url isn't updated unless an actual page load happens, which means it isn't updated in situations such as:

  • the user navigates within the same page using a URL fragment like <a href="#thing>go to thing</a>
  • the web app is an SPA that intercepts navigation events (for example, using the Navigation API) and updates the page content using client-side JavaScript

This is unituitive, partly because the value of Client.url would in these cases not match document.location.href or the URL bar.

I've tested this, and have tried to express it. I'm not sure what the best language to use here is though.

Side note, the Navigation API docs are lacking any guide docs. I had to read https://developer.chrome.com/docs/web-platform/navigation-api to understand how to use it, and that guide although good is quite out of date.

@wbamberg wbamberg requested a review from a team as a code owner April 17, 2026 18:44
@wbamberg wbamberg requested review from chrisdavidmills and removed request for a team April 17, 2026 18:44
@github-actions github-actions Bot added Content:WebAPI Web API docs size/s [PR only] 6-50 LoC changed labels Apr 17, 2026
@github-actions
Copy link
Copy Markdown
Contributor

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/s [PR only] 6-50 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Very misleading example for window focus from notification / service worker Client URL does not change upon subsequent navigation

2 participants