Excluding scopes from SW control

8 views
Skip to first unread message

Yoav Weiss (@Shopify)

unread,
Jan 22, 2025, 10:28:29 AMJan 22
to Yoshisato Yanagisawa, worker-dev, Domenic Denicola
Hey folks!

I would like to put together a SW-related proposal and wasn't sure what's the best venue for that. I'd love your thoughts on this.

I have a use-case where I'd like to exclude certain paths from a SW scope, and ensure that any requests to document in those paths, or the subresources that they trigger will not be intercepted by a SW. In some ways, it's the inverse of the `Service-Worker-allowed` header.

What's the best venue to kick off such a proposal? Is that an issue/PR on the SW spec? somewhere else?

Cheers :)
Yoav

Shunya Shishido

unread,
Jan 22, 2025, 7:37:34 PMJan 22
to Yoav Weiss (@Shopify), Yoshisato Yanagisawa, worker-dev, Domenic Denicola
Hi Yoav!

Thanks for reaching out.

I think your use case can be achieved by using the ServiceWorker Static Routing API. You can specify certain paths in a router condition, and set "network" as a router source. Then the request will bypass ServiceWorker interception if it matches the router condition. You can check more detail in https://github.com/WICG/service-worker-static-routing-api.

Let me know if you have any other questions!

--
You received this message because you are subscribed to the Google Groups "worker-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to worker-dev+...@chromium.org.
To view this discussion visit https://groups.google.com/a/chromium.org/d/msgid/worker-dev/CAOmohSLaTRKLCOpohNNBZuT5hT4aaBFRudvn4MkxC80JTXYdUg%40mail.gmail.com.

Yoshisato Yanagisawa

unread,
Jan 22, 2025, 10:20:44 PMJan 22
to Shunya Shishido, Yoav Weiss (@Shopify), worker-dev, Domenic Denicola
Thanks Yoav for reaching out to us, and thanks Shunya for answering this.

I think people usually discuss the new ServiceWorker related proposals in the github issue (https://github.com/w3c/ServiceWorker/issues).
When you have a new proposal, please write it there.

For this case, as Shunya replied, I feel it is covered by the SW static routing API.  Moreover, as written in the explainer, it was our original motivation to bring the API.
However, as Shunya pointed out in person, people may also wonder if they can apply the rule to subsequent subresource loads when the main resource load matches the rule.

2025年1月23日(木) 9:37 Shunya Shishido <sisid...@chromium.org>:

Yoav Weiss (@Shopify)

unread,
Jan 23, 2025, 2:39:23 AMJan 23
to Yoshisato Yanagisawa, Shunya Shishido, worker-dev, Domenic Denicola
Thanks!

I don't believe the static routing API fully covers the use case. I'll open an issue on the ServiceWorker spec to fully outline why :)

Cheers,
Yoav

Yoav Weiss (@Shopify)

unread,
Jan 24, 2025, 6:56:43 AMJan 24
to worker-dev, Yoav Weiss (@Shopify), Shunya Shishido, worker-dev, Domenic Denicola, Yoshisato Yanagisawa
https://github.com/w3c/ServiceWorker/issues/1690#issuecomment-2612333273

Cheers :)
Yoav

To unsubscribe from this group and stop receiving emails from it, send an email to worker-dev+unsubscribe@chromium.org.

Yoshisato Yanagisawa

unread,
Jan 27, 2025, 1:49:22 AMJan 27
to Yoav Weiss (@Shopify), worker-dev, Shunya Shishido, Domenic Denicola
Thanks for mentioning the issue.
Let's discuss this there.

2025年1月24日(金) 20:56 Yoav Weiss (@Shopify) <yoav...@chromium.org>:
To unsubscribe from this group and stop receiving emails from it, send an email to worker-dev+...@chromium.org.
Reply all
Reply to author
Forward
0 new messages