Repository navigation
fix(browser): deliver agent clicks and keys to pages that loaded while their pane was hidden - #34291
Merged
Merged
Conversation
…e their pane was hidden A page that loads while its browser pane is parked (display:none) never paints, and Chromium drops input to a document before its first paint. orca click/hover/keypress/mouse on such a page reported success after a ~5 s mouseMoved stall while the page got no press or key. Before agent input reaches a webview guest, from the CDP proxy queue or the bridge's direct pointer and key routes, ask the page whether it has painted. If not, hold its paint with the existing capture paint hold until a paint entry appears or a few frames pass, once per document. Co-authored-by: outof-place <contact@outofplace.space>
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 7 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
7 of 9 tasks
8 of 9 tasks
5 of 8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
When an agent loaded a page in a browser tab hidden behind another tab,
orca click,hover,keypressandmouseon that page reported success after a ~5 s stall, and the page got no press and no key. In a hidden dev build on main, a click aftergotoin a parked tab took 5.35 s and the page saw onlymouseover.keypressandtypewere lost too. With this change the same click takes ~0.3 s and delivers mousedown, mouseup and click, and keys and typing arrive.A document that loads while its pane is parked (
display: none) never paints. Chromium drops input to a document before its first paint, and it holds mouse moves for a frame that never comes. A page that painted before it was parked takes input normally.Before agent input reaches a webview guest, Orca now asks the page whether it has painted. If it hasn't, the existing capture paint hold keeps the pane drawn until a paint entry appears or a few frames pass, then lets go. This happens once per document, in the CDP proxy's input queue and in the bridge's direct pointer and key commands, so every input route goes through it. A painted page costs one fast probe.
The hold ends at the first paint instead of wrapping each input, because every release re-throttles the whole Orca window.
Known limit: a document that never paints anything (an empty body) can still lose its very first key while Chromium holds back its first commit.
Supersedes #27310 by @outof-place, which found the same cause and the paint-entry wait. That branch sits on an older agent-browser bump, the proxy it changed has since been restructured, and it leaves keys out. This version works on the current input queue and also covers keys and the bridge's own mouse commands. #29161 (scripts waiting on frames) is a separate case and stays as it is.
Fixes #27309