v135 · service worker

Service Worker client URL ignore history.pushState changes

Modify the service worker Client.url property to ignore document URL changes via history.pushState() and other similar history APIs. The Client.url property is intended to be the creation URL of the HTML document which ignores such changes.

concepts

  1. SW client URL

    Live probe: push a new state from the page and check what the SW now reports.

  2. Why your SPA route used to confuse clients.openWindow

    The motivating SPA scenario: clients.openWindow used to focus a stale tab matching a pushState URL. The fix makes Client.url stay at the document's creation URL.

  3. Route mismatch detective

    Buttons trigger pushState, hash changes, and reload. The two panels show document.location.href and the simulated Client.url — with green / red highlighting whenever they diverge.

  4. SW scope audit

    Configure a SW scope and a list of pushState routes. The audit shows what Client.url the SW sees in Chrome 135 (creation URL) vs pre-135 (latest pushState URL), and which routes would previously have caused scope-mismatch bugs in clients.matchAll().

why it shipped

Match the spec described behavior implemented by Firefox and Safari to improve compatibility.

references