Web Developer Tools Network Throttle Offline Ignores Service Worker
Categories
(DevTools :: Netmonitor, defect)
Tracking
(Not tracked)
People
(Reporter: Jan.Klass, Unassigned)
References
Details
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:130.0) Gecko/20100101 Firefox/130.0
Steps to reproduce:
- Open Website with service worker that serves responses from cache
- Open Web Developer Tools
- Open Network tab
- Set Throttling to Offline
Actual results:
I can not open the website anymore.
Expected results:
When opening the website the Service Worker should receive the fetch request and serve the response from cache.
Currently, "Offline" behaves different from disabling WiFi / being actually offline. In those cases the service worker still works and serves as expected.
With a Service Worker installed, it can handle fetch requests, service HTTP responses from Cache. This works even when offline.
In the Firefox Web Developer Tools Network section, Throttling offers an "Offline" option.
I expect Offline Throttling to behave like turning off wifi or unplugging a network cable or disabling a network interface.
I expect the Service Worker to still be in effect and be used and be able to serve from cache.
Being able to test offline functionality of PWA/Service Worker Cache for offline availability through Offline Throttling would be very useful.
Firefox does not currently provide other alternatives for testing this.
Edge and Chrome offer Offline Throttling too. They do not ignore Service Workers. They work as expected.
Comment 3•6 months ago
|
||
The Bugbug bot thinks this bug should belong to the 'DevTools::Netmonitor' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Comment 4•6 months ago
|
||
Thanks for filing, we have another similar bug being fixed at Bug 1907304.
Once this lands, we should retry the STRs here and see if this requires additional fixes.
Comment 5•6 months ago
•
|
||
Hi!
We just landed a fix for offline mode over at Bug 1907304.
Could you share specific steps to reproduce so that we can verify if your use case is fixed as well?
Otherwise you could test on your own with the latest Firefox Nightly.
Thanks!
The ASP.NET Core Blazor WebAssembly project template includes a service worker service-worker.published.js
which stores assets via Cache API and then intercepts HTTP requests to serve responses from Cache API.
Is that sufficient? Or would you require a minimal project / minimal example?
With a Service Worker intercepting requests and Cache Storage in place, the reproduction is as simple as opening the web developer tools and setting throttling to offline (as described in the original report).
Comment 7•6 months ago
|
||
Seems to work for me on a simple serviceworker testpage: https://bncb2v.csb.app/
Will close as duplicate, but feel free to reopen if you still have the issue with Firefox 132
I checked the page you linked https://bncb2v.csb.app/
and I can see
- it serves requests through a service worker, and uses cache API
- in Firefox 130 setting throttling to offline leads to the issue as expected
It seems to be a valid test case for this issue.
Thank you
Description
•