FORGE KUI / docs

DevTools protocol and methods

Connection, wire format, domains, events and security boundaries, based on the current KUI implementation.

Version 3.61.7

HTTP discovery, WebSocket commands

After the app starts DevTools, the server binds to loopback by default. /json and /json/list return targets; /json/version returns version metadata. A target’s webSocketDebuggerUrl points to its WebSocket. Each instance has its own authentication token. Keep that URL inside trusted debugging processes and do not start the server unconditionally in a distributed app.

The request and response shape

A command has an integer id, a method and params. Success returns result with the same id. The default protocol places failures in a top-level error with code and message. This example shows only the request; it does not print an authenticated URL.

json
{"id":7,"method":"DOM.querySelector","params":{"selector":"#save"}}

Default v3.2 and older clients

The default v3.2 envelope puts an unknown-method error at the top level, for example code -32601. Older clients can add proto=v3.1 to the WebSocket URL to keep errors inside result. This is KUI’s response-envelope version, not Chromium’s CDP version or the engine/SDK version.

json
{"id":7,"error":{"code":-32601,"message":"Unknown method: Unknown.method"}}

Find methods by task

This table lists representative methods rather than a fixed total. Check the bundled documentation and the current server route table for the exact set. Some methods belong to KUI-specific domains.

Representative KUI DevTools methods
TaskMethod examplesWhat it provides
DOM and listenersDOM.getDocument · DOM.querySelector · DOM.getEventListeners · DOM.setTextContentFind nodes, listeners and edit text at runtime
Inspect or edit CSSCSS.getComputedStyle · CSS.getMatchedRules · CSS.setPropertyComputed values, matched rules and live edits
Inspect the pagePage.getInfo · Page.screenshot · Page.getLayoutMetricsTarget info, screenshot and viewport geometry
Operate the UIInput.dispatchMouseEvent · Input.dispatchKeyEventMouse, keyboard and real interactions
Debug LuaDebugger.setBreakpoint · Debugger.getScope · Runtime.evaluateBreakpoints, variables and expressions
Read logsConsole.getMessages · Console.evaluateConsole messages and Lua evaluation
Measure performancePerformance.startRecording · Performance.getFrameDetails · Performance.getHotNodesRecording, slow frames and node attribution
Inspect rendering optionsRendering.getOptions · Rendering.setOptionDevelopment-time runtime A/B
Inspect other stateNetwork.getResources · Accessibility.getFullAXTree · Page.startScreencastResources, accessibility tree and screencast
Debug storageStorage.getDOMStorageItems · Storage.setDOMStorageItemKey-value state held in this service’s memory

Events are pushed, not command responses

With DOM push enabled, the server can send events such as DOM.childNodeInserted and DOM.attributeModified. It can also push Console.messageAdded, Debugger.paused, Page.screencastFrame and recording completion. Handle events without an id by method, and match responses by id. DOM.disable stops DOM mutation push for a read-only client.

Compatibility endpoints have limits

Page.captureScreenshot and Runtime.evaluate are CDP-style aliases; the latter executes Lua. Some *.enable, Target and ServiceWorker methods only return bootstrap-compatible responses and do not start browser features. Page.reload is not registered; HTML/CSS file watching belongs to a separate HotReload helper. Storage methods operate key-value maps in this DevTools server’s memory, not browser persistent storage. Unknown methods fail. The incoming WebSocket frame limit is 2 MiB; a larger MCP response limit does not raise the request limit.

Treat the connection as privileged

DevTools can read DOM, logs and script state, and can change the UI. The default /json discovery response may contain an authenticated URL. Keep tokens out of shared logs and screenshots. Use the service in a trusted local development environment; prefer an SSH tunnel for remote debugging, and disable or harden it before distribution.