Reputation: 8188
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?
Upvotes: 6
Views: 4467
Reputation: 1291
Also, you could go to the Networks tab and perform the same action. Hope this helps :)
Upvotes: 1
Reputation: 5497
In Chrome, you can simulate being offline in the DevTools' Application
tab, inside the Service Workers
panel. You will see there a checkbox that says "Offline".
Upvotes: 5