humanizer_scroll
Scroll a webpage by dispatching a single wheel event with specified vertical and horizontal pixel deltas.
Instructions
Dispatch a wheel event. Raw page.mouse.wheel — single event, not multi-step.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| target_id | Yes | Target ID from interceptor_browser_launch or interceptor_camoufox_launch | |
| delta_y | Yes | Vertical scroll delta in pixels (positive = scroll down) | |
| delta_x | No | Horizontal scroll delta in pixels (default: 0) |
Implementation Reference
- src/tools/humanizer.ts:145-175 (registration)Tool 'humanizer_scroll' registered via server.tool() with Zod schema for target_id, delta_y, delta_x and async handler that delegates to humanizerEngine.scroll.
// ── humanizer_scroll ─────────────────────────────────────────── server.tool( "humanizer_scroll", "Dispatch a wheel event. Raw page.mouse.wheel — single event, not multi-step.", { target_id: z.string().describe("Target ID from interceptor_browser_launch or interceptor_camoufox_launch"), delta_y: z.number().describe("Vertical scroll delta in pixels (positive = scroll down)"), delta_x: z.number().optional().default(0) .describe("Horizontal scroll delta in pixels (default: 0)"), }, async ({ target_id, delta_y, delta_x }) => { try { const result = await humanizerEngine.scroll(target_id, delta_y, delta_x); return { content: [{ type: "text", text: JSON.stringify({ status: "success", target_id, action: "scroll", delta: { x: delta_x, y: delta_y }, stats: { total_ms: result.totalMs, events_dispatched: result.eventsDispatched }, }), }], }; } catch (e) { return { content: [{ type: "text", text: JSON.stringify({ status: "error", target_id, action: "scroll", error: errorToString(e) }) }] }; } }, ); - src/tools/humanizer.ts:147-161 (handler)Async handler function that extracts target_id, delta_y, delta_x, calls humanizerEngine.scroll(), and returns a JSON response with status, target_id, action, delta, and stats.
server.tool( "humanizer_scroll", "Dispatch a wheel event. Raw page.mouse.wheel — single event, not multi-step.", { target_id: z.string().describe("Target ID from interceptor_browser_launch or interceptor_camoufox_launch"), delta_y: z.number().describe("Vertical scroll delta in pixels (positive = scroll down)"), delta_x: z.number().optional().default(0) .describe("Horizontal scroll delta in pixels (default: 0)"), }, async ({ target_id, delta_y, delta_x }) => { try { const result = await humanizerEngine.scroll(target_id, delta_y, delta_x); return { content: [{ type: "text", - src/tools/humanizer.ts:155-156 (schema)Zod schema for humanizer_scroll: target_id (string), delta_y (number), delta_x (optional number, default 0).
}, async ({ target_id, delta_y, delta_x }) => { - src/humanizer/engine.ts:152-161 (helper)Core scroll implementation: gets the Playwright page for the target, calls page.mouse.wheel(deltaX, deltaY), and returns totalMs and eventsDispatched.
async scroll( targetId: string, deltaY: number, deltaX?: number, ): Promise<{ totalMs: number; eventsDispatched: number }> { const page = await getPageForTarget(targetId); const start = Date.now(); await page.mouse.wheel(deltaX ?? 0, deltaY); return { totalMs: Date.now() - start, eventsDispatched: 1 }; }