w3c / w3c/ServiceWorker

Should a service worker be allowed to register new service workers?

Open
#1,117 8 comments 1 reaction 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

In the spec as currently written navigator.serviceWorker.register is exposed in all worker contexts, including service workers. That will then allow a service worker to register arbitrarily many new service workers (which could be nicely abused for some sort of nested worker support), as long as it uses different scopes for each. Is that desirable though?
Currently no implementation seems to actually have implemented navigator.serviceWorker in service worker contexts (or in any worker contexts for that matter, as far as I can tell). But if they do, and this is actually something that should be supported implementations need to be careful that this isn't an avenue that can be used to keep a worker alive indefinitely (by "forking" itself repeatedly before it is killed).

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 by reviewing the specification text governing navigator.serviceWorker exposure in worker contexts. Determine whether service workers may register additional service workers and address the indefinite-worker-lifetime concern; done requires a settled specification decision.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.