Loading...
Loading...
This skill should be used when the user asks to "debug the electron app", "connect playwright to VoiceTree", "take screenshots of the running app", "interact with the live UI", "inspect the running application", or "test UI elements live". Provides step-by-step instructions for connecting Playwright MCP to a running Electron app for live debugging and automation.
npx skill4agent add voicetreelab/voicetree playwright-debugcd webapp && npm run electron:debugprettySetupAppForElectronDebugging()example_smallRun with a bash timeout (e.g. 30s) since this is a long-running dev server.
curl -s http://localhost:9222/json/version"Browser": "Chrome/..."browser_navigatepage.goto()// browser_evaluate — check cytoscape nodes
const cy = window.cytoscapeInstance;
JSON.stringify({ nodeCount: cy.nodes().length, edgeCount: cy.edges().length });browser_snapshotbrowser_take_screenshotawait window.electronAPI.main.initializeProject('/path/to/folder');| Tool | Purpose |
|---|---|
| Get accessibility tree of current page |
| Click elements by ref |
| Hover over elements |
| Type into inputs |
| Run JavaScript in page context |
| Switch between tabs |
| Wait for text/elements |
| Capture visual screenshot |
window.electronAPI// Via browser_evaluate
Object.keys(window.electronAPI.main)
// Key methods:
window.electronAPI.main.prettySetupAppForElectronDebugging() // Spawn debug terminals
window.electronAPI.main.initializeProject(path) // Open a folder
window.electronAPI.main.getGraph() // Get graph data
window.electronAPI.main.getNode(id) // Get node details
window.electronAPI.main.loadSettings() // App settingswindow.cytoscapeInstance// Get all nodes in the graph
const cy = window.cytoscapeInstance;
cy.nodes().map(n => ({ id: n.id(), isContext: n.data('isContextNode') }));
// Get node count
cy.nodes().length;electron:debugbrowser_navigatepage.goto()/jsonbrowser_evaluatebrowser_snapshotbrowser_take_screenshotpkill -f electronkill -9# Find ONLY the process listening on port 9222
lsof -i :9222 -sTCP:LISTEN
# Then kill that specific PID
kill <pid>pkill -f electronlsof -i :9222-sTCP:LISTEN| Issue | Solution |
|---|---|
| Connection refused | Ensure Electron started with |
| Timeout on first connect | Retry - first connection can be slow |
| Wrong tab selected | |
| Native dialog opened | Use JavaScript APIs instead - native dialogs can't be automated |
| Old Electron still running | |
Claude Code → @playwright/mcp --cdp-endpoint http://localhost:9222 → CDP → Electron App → VoiceTree WebappelectronAPI.main.initializeProject()