17

Does the chrome developer console have an API to change the network throttle?

I've been looking through the documentation and not come across anything yet, however is there perhaps an undocumented / dug deep somewhere feature?

Alex KeySmith
  • 16,657
  • 11
  • 74
  • 152
  • Sorry for digging, but have you actually found anything? – Délisson Junio Nov 30 '16 at 14:57
  • @wingleader not directly, but lighthouse https://developers.google.com/web/tools/lighthouse/ seems a good fit. – Alex KeySmith Nov 30 '16 at 15:03
  • Can you tell me what you're trying to accomplish? And where exactly do you need to set network throttling from? Does it have to be from the page's JavaScript? Could you instead use a browser automation tool to throttle the network? There are various possible solutions, but I need to know what you're trying to accomplish first. – Kayce Basques Jan 08 '18 at 21:46
  • Hi @KayceBasques to be honest I can't remember it was over 2 years ago :-) I think I was using browser automation tools such as selenium and browserstack back then. And aware of throttling such as via fiddler. I'd guess I was probably trying to trigger it via selenium perhaps. I'm not doing much web development these days, but I'll leave the question here as it's got a few votes in case anyone finds it useful. – Alex KeySmith Jan 10 '18 at 19:09
  • 1
    I'm looking for a way to achieve this because I'm testing slow network loading *but* I dont' want to wait for the page load as my slow network loading tests are triggered after the page has been loaded... Still looking for a solution :) – Hugo H Jun 18 '18 at 14:58
  • @HugoH your use case is a little different. I think you'd be better off creating your own question. If you ping me, I'll try to answer it. Please provide a step-by-step example of what you're trying to do. – Kayce Basques Oct 12 '18 at 22:09
  • @KayceBasques sure, just did: https://stackoverflow.com/questions/52790399/chrome-devtools-throttle-network-after-page-load Thanks! – Hugo H Oct 13 '18 at 07:05

1 Answers1

5

I'm the technical writer for DevTools. I'm just going to answer this question narrowly:

Does the chrome developer console have an API to change the network throttle?

No. There is no API that you can run from the DevTools Console that allows you to change the network throttling speed. You can file a feature request at https://crbug.com. If you do create a request, please post the URL as a comment to this answer, and I'll update this answer to point people to that ticket. The more people star the request, the higher priority it gets.

P.S. when I say "the Console" I'm referring to this "tab" (we call them "panels"):

The Console

The collective set of features is just called DevTools.

Kayce Basques
  • 23,849
  • 11
  • 86
  • 120
  • Thanks Kayce great authoritative answer, I'm in a different world now not doing web development day to day, so must admit I've forgotten my exact use case, I suspect it was for browser automation. I'll let someone else open a ticket if it's still something relevant these days, as I'm probably not as familiar with contemporary tooling as I could be. Thanks though! – Alex KeySmith Oct 14 '18 at 19:20
  • I was looking for the similar thing and filed an issue https://bugs.chromium.org/p/chromium/issues/detail?id=1078766 – Alex Buznik May 06 '20 at 10:41
  • I want to build an extension that enables network throttling in the browser. I feel the feature will not be completed. I am experimenting with intercepting AJAX response and writing it slowly, but don't have anything concrete yet. – rbansal Sep 22 '21 at 02:40