Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Distributing service worker script via SXG #807

Open
ulan opened this issue Nov 6, 2022 · 1 comment
Open

Distributing service worker script via SXG #807

ulan opened this issue Nov 6, 2022 · 1 comment

Comments

@ulan
Copy link

ulan commented Nov 6, 2022

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.

@rektide
Copy link

rektide commented Dec 21, 2024

Yeah this feels critical for #870!!! Would really like to see sxg support this use case!!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants