hover
Simulate mouse hover at specified coordinates in Chrome for browser automation and debugging tasks.
Instructions
将鼠标悬停在指定坐标位置
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| coordinate | Yes | 悬停位置的坐标,格式为 'x,y' |
Implementation Reference
- src/browserSession.ts:525-533 (handler)The main handler function for the 'hover' tool. It moves the mouse to the specified coordinate using Puppeteer, applies a small delay for hover effects, and includes network activity monitoring via handleMouseInteraction.async hover(coordinate: string): Promise<BrowserActionResult> { return this.doAction(async (page) => { await this.handleMouseInteraction(page, coordinate, async (x, y) => { await page.mouse.move(x, y); // 小延迟以允许任何悬停效果出现 await delay(300); }); }); }
- src/index.ts:126-139 (schema)The schema definition for the 'hover' tool in the tool list response, defining the input parameter 'coordinate' as a string in 'x,y' format.{ name: "hover", description: "将鼠标悬停在指定坐标位置", inputSchema: { type: "object", properties: { coordinate: { type: "string", description: "悬停位置的坐标,格式为 'x,y'", }, }, required: ["coordinate"], }, },
- src/index.ts:211-216 (registration)The dispatch logic in the CallToolRequestSchema handler that routes 'hover' tool calls to the browserSession.hover method, including input validation.case "hover": if (!args?.coordinate) { throw new Error("coordinate参数是必需的"); } result = await this.browserSession.hover(args.coordinate as string); break;