fix(server): text-only browser snapshots no longer hang on hidden tabs #21494
Closed
Byntham(GitHub profile, opens in a new tab)wants to merge 3 commits into
main fromrefs/pull/21494/head·opened View on GitHubShowing 8 changed files with 29 additions and 11 deletions (loading 5).
x
@@ -202,8 +202,14 @@
- const { includeImage: _includeImage, save: _save, ...operationInput } = input ?? {};
- return invokeTargeted<PreviewAutomationSnapshot>("snapshot", operationInput);
+ const { includeImage, save, ...operationInput } = input ?? {};
+ // A capture makes a hidden desktop tab paint until it answers; skip one nobody reads.
+ return invokeTargeted<PreviewAutomationSnapshot>(
+ "snapshot",
+ includeImage === true || save === true
+ ? operationInput
+ : { ...operationInput, screenshot: false },
+ );
@@ -137,7 +137,7 @@
- "Use it only when the current request asks for browser work, including checking an edit in the browser. Never use it unasked to verify your own edit, or to repeat a snapshot from an earlier turn. Works on a tab the user is driving. Returns page state, elements, diagnostics, and screenshot size. Target one element with `locator='aria-ref=<ref>'` from `accessibilityTree`, even in frames. Refs die on navigation, a new snapshot, or handoff. Text caps near 20 KB; on your own or an unclaimed tab, `preview_evaluate` reads more. To show a screenshot: `save=true`, then embed .",
+ "Use it only when the current request asks for browser work, including checking an edit in the browser. Never use it unasked to verify your own edit, or to repeat a snapshot from an earlier turn. Works on a tab the user is driving. Returns page state, elements, and diagnostics, plus screenshot size with `includeImage`. Target one element with `locator='aria-ref=<ref>'` from `accessibilityTree`, even in frames. Refs die on navigation, a new snapshot, or handoff. Text caps near 20 KB; on your own or an unclaimed tab, `preview_evaluate` reads more. To show a screenshot: `save=true`, then embed .",