Skip to content

Inconsistencies due to when clients are created #870

@jakearchibald

Description

@jakearchibald

https://jakearchibald.github.io/isserviceworkerready/demos/clients-count/

  1. Visit the above
  2. Hit shift + refresh
  3. Hit refresh

Chrome says 1, Firefox says 0.

The Firefox behaviour seems right to me, but unless I'm reading it wrong, the spec isn't clear around this. This might be because of earlier confusion around when clients are created.

From https://html.spec.whatwg.org/multipage/browsers.html#navigating-across-documents:

Set request's client to the source browsing context's active document's Window object's environment settings object

If I'm reading this correctly, the client is the window being navigated, not a new client ready for the new page.

From https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#on-fetch-request-algorithm 12.1:

If client is not a secure context, return null.

This seems to assume that the client is a new client ready for the new page, but doesn't this mean that SW will fail if you're navigating from an unrelated insecure page?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions