Testing ServiceWorker from Devtools Local Override

254 views
Skip to first unread message

Brent Kimmel

unread,
Aug 9, 2019, 1:55:23 AM8/9/19
to service-worker-discuss
Is it possible to run a SW from the devtools "Local Override" feature in the Sources Panel? I have a SW and confirmed that it gets the proper response when I use a .fetch('/serviceworker.js') but when I try to .register it, I get a: "TypeError: Failed to register a ServiceWorker: A bad HTTP response code (404) was received when fetching the script." The timing for the request shows as "Stalled" in the Network panel. I'm guessing it's getting hung up on an origin check w.r.t. to the Devtools Request Interceptor, but the error isn't describing that. Not the biggest thing and I can work around it, but it would be helpful to debug/dev SWs generally.

Makoto Shimazu

unread,
Aug 9, 2019, 3:21:59 AM8/9/19
to Brent Kimmel, service-worker-discuss
Hi Brent,

Thanks for reporting it.
I'm not quite familiar with the local override feature, but I can guess fetch() in the page and loading a service worker script would go through a different path so that the local override doesn't cover a service worker script.
I'd appreciate if you could report it as a bug at https://crbug.com/new.

Thanks!
Makoto

2019年8月9日(金) 14:55 Brent Kimmel <bki...@gmail.com>:
Is it possible to run a SW from the devtools "Local Override" feature in the Sources Panel? I have a SW and confirmed that it gets the proper response when I use a .fetch('/serviceworker.js') but when I try to .register it, I get a: "TypeError: Failed to register a ServiceWorker: A bad HTTP response code (404) was received when fetching the script." The timing for the request shows as "Stalled" in the Network panel. I'm guessing it's getting hung up on an origin check w.r.t. to the Devtools Request Interceptor, but the error isn't describing that. Not the biggest thing and I can work around it, but it would be helpful to debug/dev SWs generally.

--
You received this message because you are subscribed to the Google Groups "service-worker-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to service-worker-di...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/service-worker-discuss/a1dcc76e-8df5-4618-9202-7fccfc5ea801%40chromium.org.
Reply all
Reply to author
Forward
0 new messages