How to test service workers offline mode in localhost?

醉酒当歌 提交于 2019-12-10 18:11:19

问题


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?


回答1:


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".




回答2:


Also, you could go to the Networks tab and perform the same action. Hope this helps :)



来源:https://stackoverflow.com/questions/43195485/how-to-test-service-workers-offline-mode-in-localhost

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!