w3c / w3c/ServiceWorker

Service worker registration when context doing the registration goes away

Open
#1,781 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Bikeshed
Stars
3.6k
Forks
324
Avg merge
14d 22h
Merged PRs (30d)
1

Description

Let's say a document is starting to register a service worker and is quickly going away before the service worker script is loaded.
Given the document is the fetch request client, it is expected that the service worker script fetch is terminated as the document is aborted. It then follows that the service worker never gets registered.

This can be tested in https://github.com/WebKit/WebKit/blob/main/LayoutTests/http/wpt/service-workers/register-then-reload.html.
Safari follows the spec (or my interpretation of the spec at least), while Chrome and Firefox seem to continue the fetching of the script and the registration of the service worker.

We should try to converge implementations and clarify the specification.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with LayoutTests/http/wpt/service-workers/register-then-reload.html and the issue's description of document abortion during service-worker script fetching. Compare Safari's behavior with Chrome and Firefox and the relevant specification interpretation; done means the expected behavior and specification wording are clarified so implementations can converge.

Written by the indexing model from the issue text.

Assessment

Domain
documentation, web-dev
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.