probe_page
Measure DOM elements and capture PNG screenshots in real local Chrome, with optional in-page login so authenticated views include httpOnly cookies.
Instructions
Measure and/or screenshot a page in real local Chrome.
Args:
url: full URL to probe (http/https/file)
measure_js: in-page JS expression (IIFE returning an object) evaluated
after load; its value comes back as measurements. Example that
measures one element's real text width:
(() => { const el = document.querySelector('#target'); if (!el) return null;
const b = el.getBoundingClientRect(); const cs = getComputedStyle(el);
return { x: Math.round(b.x), y: Math.round(b.y), w: Math.round(b.width),
h: Math.round(b.height),
usable_text_width: Math.round(el.clientWidth
- parseFloat(cs.paddingLeft) - parseFloat(cs.paddingRight) - 2) }; })()
viewport_w / viewport_h: emulated viewport (also set via
Emulation.setDeviceMetricsOverride, so it holds regardless of
the Chrome window size)
screenshot: capture a PNG and return it as base64
login: "user:pass" - a JSON POST login executed IN the page context
before measuring (httpOnly cookies are fine - the page fetch
carries them). Requires the target app to have a JSON login API.
login_url: login endpoint path, default /api/auth/login
login_body: JSON template with %u / %p placeholders,
default {"username":"%u","password":"%p"}
timeout_ms: overall probe timeout
Returns: {ok, origin, viewport, login_status, measurements, png_base64}
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | ||
| login | No | ||
| login_url | No | ||
| login_body | No | ||
| measure_js | No | ||
| screenshot | No | ||
| timeout_ms | No | ||
| viewport_h | No | ||
| viewport_w | No |