Skip to content

Debugger

import { createDebuggerPlugin } from "webotron/plugins/debugger";
  • createDebuggerPlugin(options)
const debuggerPlugin = createDebuggerPlugin({
target: view,
onPause: (pause) => console.log("Paused:", pause.reason),
});
await debuggerPlugin.enable();
// configure breakpoints / tracepoints
await debuggerPlugin.disable();
OptionTypePurpose
targetDebuggerEventTargetCDP-capable target (typically ChromeWebView).
onPausecallbackCalled when execution pauses.
onResumecallbackCalled when execution resumes.
breakpointsDebuggerBreakpoint[]Initial static breakpoints.
tracepointsDebuggerTracepoint[]Initial tracepoints with expressions.
  • Set and clear breakpoints.
  • Add tracepoints that evaluate expressions when hit.
  • Wait for pause/resume events.
  • Inspect call frames and local variables.