browsercat_hover
Hover over web page elements using CSS selectors to trigger interactive states and reveal hidden content during automated browser testing.
Instructions
Hover over 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:283-302 (handler)The handler logic for browsercat_hover tool. It waits for the specified CSS selector to appear on the page and then hovers over the element using Puppeteer's page.hover method. Returns a success message or an error if the operation fails.case "browsercat_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:89-99 (schema)The input schema definition for the browsercat_hover tool, specifying that it requires a 'selector' property of type string (CSS selector).{ name: "browsercat_hover", description: "Hover over an element on the page", inputSchema: { type: "object", properties: { selector: { type: "string", description: "CSS selector for element to hover" }, }, required: ["selector"], }, },
- index.ts:421-423 (registration)Registration of all tools including browsercat_hover via the ListToolsRequestSchema handler, which returns the TOOLS array containing the tool definition.server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS, }));