You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Follow-ups to the #311 image budget (issue #311 review):
- click({x, y, from_screenshot: true}): when the last screenshot shown to
the model was downscaled for maxImageDimension, the extension now stores
the image→CSS scale per tab and converts coordinates mechanically —
the model no longer does arithmetic from a prose note. 1:1 captures
clear the stored scale so it can never go stale.
- Chrome tabs-API screenshot fallback: normalize native-DPR captures to
exact CSS pixels before claiming coord alignment (pre-existing 2× drift
on hi-DPI displays), and decode real bitmap dims for the budget shrink
instead of trusting CSS dims.
- Chrome screenshot tool: structured result now reports coordAligned:
false when the cap forced a resize, matching the description.
- Firefox: screenshot notes no longer claim 1:1 when the capture was
downscaled; the tool capture is CSS-locked with scale:1; both notes and
tool descriptions point at from_screenshot instead.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
description: `Screenshot captured via CDP (${screenshot.data.length} bytes). CSS viewport ${cssW}×${cssH} downscaled to ${shrunk.width}×${shrunk.height} for maxImageDimension — multiply image-pixel coords by (${scaleX}, ${scaleY}) to get CSS click coords.`,
13686
+
coordDownscaled: true,
13687
+
description: `Screenshot captured via CDP (${screenshot.data.length} bytes). CSS viewport ${cssW}×${cssH} downscaled to ${shrunk.width}×${shrunk.height} for maxImageDimension. To click something you located on this image, pass its image-pixel coords as click({x, y, from_screenshot: true}) — they are converted to CSS pixels automatically.`,
description: `Screenshot captured via tabs API (${shrunk.dataUrl.length} bytes base64). CSS viewport ${cssW}×${cssH} downscaled to ${shrunk.width}×${shrunk.height} for maxImageDimension — multiply image-pixel coords by (${scaleX}, ${scaleY}) to get CSS click coords.`,
13791
+
coordDownscaled: true,
13792
+
description: `Screenshot captured via tabs API (${shrunk.dataUrl.length} bytes base64). CSS viewport ${cssW}×${cssH} downscaled to ${shrunk.width}×${shrunk.height} for maxImageDimension. To click something you located on this image, pass its image-pixel coords as click({x, y, from_screenshot: true}) — they are converted to CSS pixels automatically.`,
Copy file name to clipboardExpand all lines: src/chrome/src/agent/tools.js
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -262,7 +262,7 @@ export const AGENT_TOOLS = [
262
262
type: 'function',
263
263
function: {
264
264
name: 'click',
265
-
description: 'Click an element. FOUR ways to use it: (1) CSS selector, (2) visible text, (3) element index from get_interactive_elements, (4) x/y coordinates. For text clicks, default matching is EXACT and case-insensitive. You can opt into broader matching with `textMatch: "prefix"` or `textMatch: "contains"`. Note: jQuery/Playwright pseudo-classes like `:contains()` and `:has-text()` are NOT valid CSS and will fail; use the `text` parameter instead. COORDINATES are CSS pixels; if using visual context, only use CSS-pixel-aligned coordinates. Prefer click_ax({ref_id}) whenever possible because it avoids coordinate drift.',
265
+
description: 'Click an element. FOUR ways to use it: (1) CSS selector, (2) visible text, (3) element index from get_interactive_elements, (4) x/y coordinates. For text clicks, default matching is EXACT and case-insensitive. You can opt into broader matching with `textMatch: "prefix"` or `textMatch: "contains"`. Note: jQuery/Playwright pseudo-classes like `:contains()` and `:has-text()` are NOT valid CSS and will fail; use the `text` parameter instead. COORDINATES are CSS pixels; if x/y were read off a screenshot image that was reported as downscaled, pass from_screenshot: true and the image pixels are converted to CSS pixels automatically. Prefer click_ax({ref_id}) whenever possible because it avoids coordinate drift.',
266
266
parameters: {
267
267
type: 'object',
268
268
properties: {
@@ -272,6 +272,7 @@ export const AGENT_TOOLS = [
272
272
index: {type: 'number',description: 'Index from get_interactive_elements result'},
273
273
x: {type: 'number',description: 'X coordinate to click'},
274
274
y: {type: 'number',description: 'Y coordinate to click'},
275
+
from_screenshot: {type: 'boolean',description: 'Set true when x/y were read off the most recent screenshot image. If that screenshot was downscaled, coordinates are converted from image pixels to CSS pixels automatically; harmless otherwise.'},
0 commit comments