Debugger
Import
Section titled “Import”import { createDebuggerPlugin } from "webotron/plugins/debugger";Entry Point
Section titled “Entry Point”createDebuggerPlugin(options)
const debuggerPlugin = createDebuggerPlugin({ target: view, onPause: (pause) => console.log("Paused:", pause.reason),});
await debuggerPlugin.enable();// configure breakpoints / tracepointsawait debuggerPlugin.disable();Common Options
Section titled “Common Options”| Option | Type | Purpose |
|---|---|---|
target | DebuggerEventTarget | CDP-capable target (typically ChromeWebView). |
onPause | callback | Called when execution pauses. |
onResume | callback | Called when execution resumes. |
breakpoints | DebuggerBreakpoint[] | Initial static breakpoints. |
tracepoints | DebuggerTracepoint[] | Initial tracepoints with expressions. |
Use Cases
Section titled “Use Cases”- Set and clear breakpoints.
- Add tracepoints that evaluate expressions when hit.
- Wait for pause/resume events.
- Inspect call frames and local variables.