Skip to main content
Glama
nfodor

Chromium ARM64 Browser

by nfodor

hover

Hover over a specific element using a CSS selector to simulate user interaction during browser automation or testing on ARM64 devices with Chromium.

Instructions

Hover over an element on the page

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
selectorYesCSS selector for the element to hover

Implementation Reference

  • The primary handler function implementing the hover tool logic. It ensures Chromium is running, queries the DOM for the specified CSS selector, retrieves the element's bounding box, calculates the center coordinates, and simulates a mouse hover by dispatching a 'mouseMoved' Input event via CDP.
    async hover(selector) { await this.ensureChromium(); const doc = await this.sendCDPCommand('DOM.getDocument'); const element = await this.sendCDPCommand('DOM.querySelector', { nodeId: doc.root.nodeId, selector }); if (!element.nodeId) { throw new Error(`Element not found: ${selector}`); } const box = await this.sendCDPCommand('DOM.getBoxModel', { nodeId: element.nodeId }); const quad = box.model.content; const x = (quad[0] + quad[4]) / 2; const y = (quad[1] + quad[5]) / 2; await this.sendCDPCommand('Input.dispatchMouseEvent', { type: 'mouseMoved', x, y }); return { content: [{ type: 'text', text: `Hovered over element: ${selector}` }], }; }
  • Input schema defining the expected parameters for the hover tool: a required 'selector' string (CSS selector).
    inputSchema: { type: 'object', properties: { selector: { type: 'string', description: 'CSS selector for the element to hover', }, }, required: ['selector'], },
  • index.js:199-212 (registration)
    The tool registration object in the tools list passed to server.setTools(), defining name, description, and input schema for the 'hover' tool.
    { name: 'hover', description: 'Hover over an element on the page', inputSchema: { type: 'object', properties: { selector: { type: 'string', description: 'CSS selector for the element to hover', }, }, required: ['selector'], }, },
  • index.js:363-364 (registration)
    Switch case in the request handler that routes 'hover' tool calls to the hover method.
    case 'hover': return await this.hover(args.selector);

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/nfodor/mcp-chromium-arm64'

If you have feedback or need assistance with the MCP directory API, please join our Discord server