w3c / w3c/ServiceWorker

should blob URLs inherit controller from parent environment or environment that called `createObjectURL()`?

Open
#1,261 16 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

Currently the spec says:

When the request’s url is local, if the service worker client's responsible browsing context is a nested browsing context or the service worker client is a worker client, the service worker client inherits the service worker registration from its parent browsing context’s environment or from the environment of a Document in the service worker client's global object's owner set, respectively, if it exists.

Is this correct for a situation like this?

// script running in window foo.com/uncontrolled.html
// no controlling worker

// register a service worker
let reg = await navigator.serviceWorker.register('sw.js', { scope: './controlled' });
await wait_for_State(reg.installing, 'activated');

// create a frame controlled by the SW
var f = await with_iframe('./controlled/frame.html');

// The controlled frame creates a blob:// URL
var blobURL = f.contentWindow.makeBlobURL();

// Create a worker from the blob URL.
// Should the worker be controlled by the frame's SW or uncontrolled?
// Spec currently says uncontrolled.
var w = new Worker(blobURL);

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 quoted service worker specification rule for local request URLs and trace how it handles a worker created from a blob URL in the provided iframe scenario. Resolve whether the worker inherits the frame's controller or remains uncontrolled, then identify the specification wording that must reflect the decision; no file or test is named in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api, web-dev
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.