I want to access my service worker's scope inside of a fetch event listener. My planned workaround was to use window.location.host
, but window
isn't available inside the service worker. I also tried using ServiceWorkerRegistration.scope (MDN doc), which would return the value I want, but this also isn't accessible inside the fetch event handler.
I'm hoping there's something similar to event.scope
(available in the registration handler), but for fetch handlers. Is this possible?