0

I'm looking to fire an offline event in Chrome DevTools console to mimic what clicking DevTools -> Network tab -> (Throttling drop-down) -> "Offline" would do.

Is there a way to do it programmatically?

onepar
  • 1
  • 1
  • You can run UI.panels.network._offlineCheckbox.inputElement.click() in devtools-on-devtools console ([instruction](/a/41202159)) – wOxxOm Sep 10 '19 at 05:57
  • @wOxxOm - thank you for your comment. The object `UI.panels.network._offlineCheckbox` doesn't seem defined in the devtools for Chrome 79, but thank you for letting me know about the devtools-on-devtools console, really cool. – onepar Oct 22 '19 at 08:51
  • Now it's a listbox so you can change UI.panels.network._throttlingSelect._selectElement.value between 'Online' and 'Offline' and then do UI.panels.network._throttlingSelect._selectElement.dispatchEvent(new Event('change')) – wOxxOm Oct 22 '19 at 09:05

0 Answers0