Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Simulate Offline Mode for HTML5 Cache Testing

I have an HTML5 application that requires offline support. I am using a local Apache server for the application, and am trying to figure out what the best way is to simulate offline mode (currently, in Firefox I disable my Air-Port to simulate offline mode, but this is a pain). Any suggestions? I am open to using other browsers if a method exists that doesn't require turning off my Internet.

like image 691
Kevin Sylvestre Avatar asked Apr 15 '10 16:04

Kevin Sylvestre


3 Answers

For Firefox
☰ (hamburger menu)->More->Work Offline

Google Chrome doesn't appear to have this feature

Edit: Also, another alternative is slightly more time-consuming to setup in the beginning but might be worth it. For Firefox/Chrome there should be proxy plugins, set up a fake/bad profile for each so that you proxy to something that doesn't exist... like 127.0.0.20:8080. After that you can switch the proxy setting on and off to emulate a full-stack test.

like image 176
David Avatar answered Sep 30 '22 21:09

David


The other answers are out of date. The only place this appears in Firefox v92 is under File > Work Offline.

The File menu can be accessed in the top left of Firefox by pressing the ALT key.

like image 29
Richard Williams Avatar answered Sep 30 '22 20:09

Richard Williams


In Chrome you can open developer tools switch to the network tab and set throttling to offline

like image 27
Deletescape Avatar answered Sep 30 '22 21:09

Deletescape