1

simulating offline state in chrome dev-tools using 'throttling: offline' result in 'No internet connection' error when trying to access web app(Angular) running on localhost:4200.

enter image description here

when manually turning off wifi and internet connection the I have access to localhost:4200 with no problem(my app does not require an internet connection to run).

It seems that 'offline' mode does not allow even access to the localhost. why is that the behavior and how can I simulate offline mode in the browser without having to manually turning on and off the internet connection on the system level?

Eliav Louski
  • 3,593
  • 2
  • 28
  • 52
  • localhost in your case is nothing else as a simulated server serving your application. This would not work if published. What is your attempt to do? When you applications needs no internet why you try to simulate offline state? – Thomas Renger Jun 08 '21 at 18:53
  • i just want to test my app in offline mod and online mod efficiently – Eliav Louski Jun 08 '21 at 18:54
  • Either use PWA features or if it is only about to test how the application behaves when the api cannot be reached, block the api instead. You can block urls und domains in the network tab. maybe you can give this approach a try – Thomas Renger Jun 08 '21 at 19:04
  • but I want to block any domain, i want to make sure my app will work offline. there is no way to easily simulate offline mode In devtools? – Eliav Louski Jun 08 '21 at 19:49

0 Answers0