You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Should active service worker for service worker be itself? #1850
However, in whatwg/fetch#303, it was decided that for showNotification(), the image requests should always be intercepted, even if the notification is created from a service worker. So perhaps we need to specify that for a service worker, the active service worker is itself (well, it's a bit awkward because "service worker client" already has a different definition from "a client that is a service worker").
Unfortunately, I do not have a clear answer for this. As you know, simply allowing the fetch handler to intercept fetches from Service Workers can easily cause an infinite fetch loop. Therefore, I feel it is difficult to settle the service worker intercept requested from showNotification() while avoiding this infinite loop.
Maybe we should bypass the fetch handler/interception if the service worker itself is the initiator?
Let me leave this open and revisit this later.
Activity
yoshisatoyanagisawa commentedon Sep 28, 2026
Unfortunately, I do not have a clear answer for this. As you know, simply allowing the fetch handler to intercept fetches from Service Workers can easily cause an infinite fetch loop. Therefore, I feel it is difficult to settle the service worker intercept requested from showNotification() while avoiding this infinite loop.
Maybe we should bypass the fetch handler/interception if the service worker itself is the initiator?
Let me leave this open and revisit this later.
ltenmoz commentedon Sep 28, 2026
There was some discussion about how to avoid infinite loops in the original issue: whatwg/fetch#303 (comment).