Integrated browser click times out on hidden agent-opened pages
- Dominant language
- TypeScript
- Stars
- 193k
- Forks
- 42.4k
- PR merge metrics
- PR metrics pending
Description
When `openBrowserPage` creates an agent browser page with `preserveFocus: true`, the page can remain hidden with a `0x0` viewport. `readPage` succeeds, but `clickElement` times out waiting for the visible, enabled control to become stable because animation frames do not advance in the hidden document.
Reproduction with a static local page:
1. Open it with `openBrowserPage` and read it successfully.
2. Call `clickElement` on its visible button; the locator resolves, then times out waiting for stability.
3. The page reports `visibilityState=hidden`, `hasFocus()=false`, and `innerWidth/innerHeight=0`. An rAF probe never completes.
4. Activating the page lifecycle/focus through CDP and reloading makes the unchanged `clickElement` call succeed.
Expected: pages returned by `openBrowserPage` are interaction-ready, or browser action tools can operate on the preserved-focus page.
Contributor guide
Assessment
This issue has not been assessed yet.