w3c / w3c/ServiceWorker

should getRegistration() return anything for clients with a local URL that inherited the controller?

Open
#1,326 2 comments 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

The ServiceWorkerContainer.getRegistration() method takes a URL, but allows it to default to the empty string. Since the value is used to resolve a URL with the client's base URL, this effectively does a getRegistration() with the client's base URL.

Should this be expected to work for clients with a local URL (about:blank, blob:, etc) that are controlled by a service worker (thanks to inheritance)? In these cases it seems a getRegistration() with the default arg will try to find a scope matching the local URL which should always fail.

It seems like the default arg form of getRegistration() is often used to get the registration for the controlling service worker. Should we try to support this use case for these local URL clients?

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 the ServiceWorkerContainer.getRegistration() entry point and its URL-resolution behavior for clients using about:blank or blob: URLs. Review how inherited service-worker control is described for local URL clients, then determine whether the specification needs a clear resolution; done means the expected behavior and any required specification change are agreed.

Written by the indexing model from the issue text.

Assessment

Domain
api, web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.