WICG / WICG/webpackage

Distributing service worker script via SXG

Open
#807 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
1.3k
Forks
125
PR merge metrics
No merged PRs in 30d

Description

We have a use case with an untrusted front-end server that hosts a service worker source script as a signed exchange:service_worker.sxg.

The main page of the website is also distributed as a signed exchange and registers the service worker as follows:

// This JS is running with the `trusted.back.end` origin.
navigator.serviceWorker.register('https://untrusted.front.end/service_worker.sxg');

Currently this fails in Chrome 107 with an error:

Failed to register a ServiceWorker: The origin of the provided scriptURL ('https://untrusted.front.end') does not match the current origin

Question: What is the expected behaviour according to the SXG specification here?

Based on the explainer and the spirit of SXG, I was expecting the service worker registration to succeed because the service worker source script resource should be considered as having the same trusted origin.

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 service worker registration call shown in the issue and read the SXG explainer and specification sections governing origin handling. Compare the expected behavior with Chrome 107's reported error; done means documenting the specification's answer and whether the observed behavior conforms to it.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.