Skip to content

Conversation

@karlseguin
Copy link
Collaborator

@karlseguin karlseguin commented Sep 4, 2025

Most CDP drivers have a mechanism to wait for idle network, or an almost idle network (sometimes called networkIdle2). These are events the browser must emit.

The page will now emit networkIdle when we are reasonably sure there's no more network activity (this requires some slight changes to request interception, since, I believe, intercepted requests should be considered).

networkAlmostIdle is currently always emitted prior to emitting networkIdle. We should tweak this but I can't, at a glance, think of a great heuristic for when this should be emitted.

@karlseguin karlseguin force-pushed the network_idle_page_lifecycle branch from fed5942 to 848a222 Compare September 4, 2025 08:35
Most CDP drivers have a mechanism to wait for idle network, or an almost idle
network (sometimes called networkIdle2). These are events the browser must emit.

The page will now emit `networkIdle` when we are reasonably sure there's no more
network activity (this requires some slight changes to request interception,
since, I believe, intercepted requests should be considered).

`networkAlmostIdle` is currently _always_ emitted prior to emitting
`networkIdle`. We should tweak this but I can't, at a glance, think of a great
heuristic for when this should be emitted.
@karlseguin karlseguin force-pushed the network_idle_page_lifecycle branch from 848a222 to 5dda86b Compare September 4, 2025 08:37
@karlseguin karlseguin merged commit d4c4024 into main Sep 4, 2025
10 checks passed
@karlseguin karlseguin deleted the network_idle_page_lifecycle branch September 4, 2025 09:48
@github-actions github-actions bot locked and limited conversation to collaborators Sep 4, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants