How can I test service workers in offline mode locally? I mean, localhost doesn't need internet access so it just keeps fetching all the files. Can I simulate offline in Firefox or Chrome somehow so I can see what happens when caching fails, or other things go wrong?
相关问题
- Is there a limit to how many levels you can nest i
- How to toggle on Order in ReactJS
- void before promise syntax
- Keeping track of variable instances
- Can php detect if javascript is on or not?
In Chrome, you can simulate being offline in the DevTools'![enter image description here](https://i.stack.imgur.com/Sl49A.jpg)
Application
tab, inside theService Workers
panel. You will see there a checkbox that says "Offline".Also, you could go to the Networks tab and perform the same action. Hope this helps :)