Alex KeySmith
Alex KeySmith

Reputation: 17091

Chrome console api - change network throttling programmatically

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?

Upvotes: 18

Views: 2657

Answers (2)

Pierz
Pierz

Reputation: 8108

You can do this using Puppeteer - see their docs on emulate network conditions.

Also you might want to take a look at the Network Trace Chrome extension that Intel developed a while ago which allows for recording and replay of network traces, via a new Network Trace tab in devtools. It's not in the Chrome store so you'll need to manually install it - though there's no 'extensions' directory as mentioned in their install doc) but you can install it by opening the Emulator directory of the repo using the 'Load unpacked' with developer mode enabled in the Extensions settings.

Upvotes: 1

Kayce Basques
Kayce Basques

Reputation: 25897

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.

Upvotes: 6

Related Questions