Skip to main content
Glama

firefox-devtools-mcp

snapshot.injected.ts811 B
/** * Snapshot injected script entry point * This gets bundled and injected into browser context */ import { walkTree } from './treeWalker.js'; import type { TreeWalkerResult } from './treeWalker.js'; /** * Create snapshot of current page * This function is called from executeScript */ export function createSnapshot(snapshotId: number): TreeWalkerResult { try { // Walk from body const result = walkTree(document.body, snapshotId, true); if (!result.tree) { throw new Error('Failed to generate tree'); } return result; } catch (error: any) { return { tree: null, uidMap: [], truncated: false, }; } } // Make it available globally for executeScript if (typeof window !== 'undefined') { (window as any).__createSnapshot = createSnapshot; }

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/freema/firefox-devtools-mcp'

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