-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add throttleNetwork on page #1094
Conversation
a96df23
to
0c7b9b2
Compare
0c7b9b2
to
793c9c5
Compare
a38f32c
to
16c8a12
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work @ankur22 👏
Just a couple of considerations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work. Thanks 👏
This is the bare bones mapping and implementation. It also adds the necessary new NetworkProfile type to enable this to work.
This adds the implementation to call chrome to perform the CDP request which will throttle the network in chrome itself.
A page can be made up of many frames, and each frame has its own session. This session maps directly to one in chrome. Generally a website will have one main frame. The new throttling api is scoped to the page so all the frames will need to have their sessions updated for a single page. This change helps with that.
Now we wire up the page with the frames.
The state of the network profile needs to be stored in memory so that it isn't overriden when the offline state is changed with setOffline.
Renaming them by removing throughput. It should be clear from the context that they reference the throughput and not any other aspect of the network.
98693e5
to
ba04a12
Compare
What?
This adds a new
throttleNetwork
API onpage
which throttles the network from chrome's perspective.Why?
A good use case for throttling the network is to see (within a lab environment) how the frontend reacts when the network is slow, e.g. on a slow 3G connection. With new measurements under a constraint network, users will be able to fine tune their website so that the most important information is returned in an acceptable timeframe.
Checklist
Related PR(s)/Issue(s)
Updates #887