demo · v135
Why your SPA route used to confuse clients.openWindow
The SPA-routing use case the spec called out: when a single-page app calls history.pushState("/inbox"), the document never actually navigates. But before Chrome 135, the service-worker observed Client.url would change to that pushState URL anyway. clients.openWindow() would then prefer the existing client and try to focus it — the user would land on a stale tab the SW thought matched /inbox. With the fix, Client.url stays at the document's actual creation URL.
SW controller: ?
pre-135 SW.Client.url
would mutate to whatever pushState set
Chrome 135+ SW.Client.url
stays at the document creation URL
live values:
location.pathname:
document creation URL:
location.pathname:
document creation URL: