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

Require [SecureContext] for interfaces with [Exposed=ServiceWorker] or not? #1749

Open
saschanaz opened this issue Jan 26, 2025 · 1 comment

Comments

@saschanaz
Copy link
Member

saschanaz commented Jan 26, 2025

The current spec only adds [Exposed] to all service-worker-specific interfaces except ServiceWorkerGlobalScope. Other specs also generally prefers not to give SecureContext, per webref:

  • Specs with SecureContext: push-api
  • Specs without SecureContext: content-index, background-sync, background-fetch, payment-handle, cookie-store, periodic-background-sync

Gecko and Blink do not add [SecureContext] for those interfaces but WebKit does. (For Gecko, devtools allows non-secure context to temporarily run service worker so SecureContext doesn't make a lot of sense)

Given there's no spec other than push-api that adds SecureContext I filed w3c/push-api#397, but then found there's no explicit agreement nor guideline, and so the issue here.

@yoshisatoyanagisawa
Copy link
Collaborator

As you know, ServiceWorkers can be executed only in the secure context, and the clients must be in the secure context to access it. https://w3c.github.io/ServiceWorker/#secure-context
Therefore, even if there is no explicit SecureContext, I assume it actually be executed inside.

Is there any corner case scenarios having SecureContext or not matter?
...stepping back, in w3c/push-api#397, you say Firefox has a way to run ServiceWorker without secure context. Is that a 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