puppeteer_hover
Simulate mouse hover interactions on web page elements using CSS selectors to trigger dynamic content, dropdown menus, or tooltips during browser automation.
Instructions
Hover an element on the page
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| selector | Yes | CSS selector for element to hover |
Implementation Reference
- index.ts:274-293 (handler)Handler function for the puppeteer_hover tool that waits for and hovers over the specified CSS selector, returning success or error message.case "puppeteer_hover": try { await page.waitForSelector(args.selector); await page.hover(args.selector); return { content: [{ type: "text", text: `Hovered ${args.selector}`, }], isError: false, }; } catch (error) { return { content: [{ type: "text", text: `Failed to hover ${args.selector}: ${(error as Error).message}`, }], isError: true, }; }
- index.ts:79-89 (schema)Input schema definition for the puppeteer_hover tool, requiring a CSS selector.{ name: "puppeteer_hover", description: "Hover an element on the page", inputSchema: { type: "object", properties: { selector: { type: "string", description: "CSS selector for element to hover" }, }, required: ["selector"], }, },
- index.ts:410-412 (registration)Registration of all tools, including puppeteer_hover, via the ListToolsRequestSchema handler that returns the TOOLS array.server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS, }));