Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There's friction between the CDP polling for data and the page polling for data.
This was previously "improved", by making it so that CDP polling would also active the page polling, and making the page somewhat aware that CDP might need polling.
This has been completely reworked.
1 - If there's a page with no CDP (./lightpanda fetch), then the page is free to exit as soon as all work is done
2 - If there's a page with CDP, the page is the only one doing the polling.
3 - If there's no page with CDP, CDP is doing the polling (which is ok, because, without a page, the only data we can get is a CDP message).
This removes the friction and allows the page to poll/timeout smartly, as it has the most context (e.g. information about scheduled tasks).
While this makes the page slightly CDP aware, this PR also removes the
page.request_interceptedfield, which poorly served a similar purpose. So, as far as CDP-pollution is concerned, it's a wash.Slightly unrelated,
requestAnimationFrameis now automatically placed in the low priority work queue. Unlike setInterval or other background tasks which are inherently repetitive,requestAnimationFrameis repetitive only because the typical use case is forrequestAnimationFrameto callrequestAnimationFrame. This circumvents our the high -> low priority migration we apply to repeating tasks, meaning thatrequestAnimationFramewould keep a page from being "done".