cdp-driver 0.3.0

Chrome DevTools Protocol client for AI agent browser control
Documentation
// @generated by `just generate-methods` from protocol/*.json.
// Do not edit by hand; edit xtask/ and regenerate.

//! Debugger domain exposes JavaScript debugging capabilities. It allows
//! setting and removing breakpoints, stepping through execution, exploring
//! stack traces, etc.
//!
//! Method names for the `Debugger` domain, for use with
//! [`CdpClient::call`](crate::CdpClient::call).

/// Continues execution until specific location is reached.
///
/// Parameters:
/// - `location`: Location
/// - `targetCallFrames`: string (optional)
pub const CONTINUE_TO_LOCATION: &str = "Debugger.continueToLocation";

/// Disables debugger for given page.
pub const DISABLE: &str = "Debugger.disable";

/// Enables debugger for the given page. Clients should not assume that the
/// debugging has been enabled until the result for this command is received.
///
/// Parameters:
/// - `maxScriptsCacheSize`: number (optional)
///
/// Returns: `debuggerId`
pub const ENABLE: &str = "Debugger.enable";

/// Evaluates expression on a given call frame.
///
/// Parameters:
/// - `callFrameId`: CallFrameId
/// - `expression`: string
/// - `objectGroup`: string (optional)
/// - `includeCommandLineAPI`: boolean (optional)
/// - `silent`: boolean (optional)
/// - `returnByValue`: boolean (optional)
/// - `generatePreview`: boolean (optional)
/// - `throwOnSideEffect`: boolean (optional)
/// - `timeout`: Runtime.TimeDelta (optional)
/// - `scopeNumber`: integer (optional)
///
/// Returns: `result`, `exceptionDetails`
pub const EVALUATE_ON_CALL_FRAME: &str = "Debugger.evaluateOnCallFrame";

/// Returns possible locations for breakpoint. scriptId in start and end range
/// locations should be the same.
///
/// Parameters:
/// - `start`: Location
/// - `end`: Location (optional)
/// - `restrictToFunction`: boolean (optional)
///
/// Returns: `locations`
pub const GET_POSSIBLE_BREAKPOINTS: &str = "Debugger.getPossibleBreakpoints";

/// Returns source for the script with given id.
///
/// Parameters:
/// - `scriptId`: Runtime.ScriptId
///
/// Returns: `scriptSource`, `bytecode`
pub const GET_SCRIPT_SOURCE: &str = "Debugger.getScriptSource";

/// `Debugger.disassembleWasmModule`
///
/// Experimental: may change without notice.
///
/// Parameters:
/// - `scriptId`: Runtime.ScriptId
///
/// Returns: `streamId`, `totalNumberOfLines`, `functionBodyOffsets`, `chunk`
pub const DISASSEMBLE_WASM_MODULE: &str = "Debugger.disassembleWasmModule";

/// Disassemble the next chunk of lines for the module corresponding to the
/// stream. If disassembly is complete, this API will invalidate the streamId
/// and return an empty chunk. Any subsequent calls for the now invalid stream
/// will return errors.
///
/// Experimental: may change without notice.
///
/// Parameters:
/// - `streamId`: string
///
/// Returns: `chunk`
pub const NEXT_WASM_DISASSEMBLY_CHUNK: &str = "Debugger.nextWasmDisassemblyChunk";

/// This command is deprecated. Use getScriptSource instead.
///
/// Deprecated in the protocol.
///
/// Parameters:
/// - `scriptId`: Runtime.ScriptId
///
/// Returns: `bytecode`
pub const GET_WASM_BYTECODE: &str = "Debugger.getWasmBytecode";

/// Returns stack trace with given `stackTraceId`.
///
/// Experimental: may change without notice.
///
/// Parameters:
/// - `stackTraceId`: Runtime.StackTraceId
///
/// Returns: `stackTrace`
pub const GET_STACK_TRACE: &str = "Debugger.getStackTrace";

/// Stops on the next JavaScript statement.
pub const PAUSE: &str = "Debugger.pause";

/// `Debugger.pauseOnAsyncCall`
///
/// Deprecated in the protocol.
/// Experimental: may change without notice.
///
/// Parameters:
/// - `parentStackTraceId`: Runtime.StackTraceId
pub const PAUSE_ON_ASYNC_CALL: &str = "Debugger.pauseOnAsyncCall";

/// Removes JavaScript breakpoint.
///
/// Parameters:
/// - `breakpointId`: BreakpointId
pub const REMOVE_BREAKPOINT: &str = "Debugger.removeBreakpoint";

/// Restarts particular call frame from the beginning. The old, deprecated
/// behavior of `restartFrame` is to stay paused and allow further CDP
/// commands after a restart was scheduled. This can cause problems with
/// restarting, so we now continue execution immediatly after it has been
/// scheduled until we reach the beginning of the restarted frame. To stay
/// back-wards compatible, `restartFrame` now expects a `mode` parameter to be
/// present. If the `mode` parameter is missing, `restartFrame` errors out.
/// The various return values are deprecated and `callFrames` is always empty.
/// Use the call frames from the `Debugger#paused` events instead, that fires
/// once V8 pauses at the beginning of the restarted function.
///
/// Parameters:
/// - `callFrameId`: CallFrameId
/// - `mode`: string (optional)
///
/// Returns: `callFrames`, `asyncStackTrace`, `asyncStackTraceId`
pub const RESTART_FRAME: &str = "Debugger.restartFrame";

/// Resumes JavaScript execution.
///
/// Parameters:
/// - `terminateOnResume`: boolean (optional)
pub const RESUME: &str = "Debugger.resume";

/// Searches for given string in script content.
///
/// Parameters:
/// - `scriptId`: Runtime.ScriptId
/// - `query`: string
/// - `caseSensitive`: boolean (optional)
/// - `isRegex`: boolean (optional)
///
/// Returns: `result`
pub const SEARCH_IN_CONTENT: &str = "Debugger.searchInContent";

/// Enables or disables async call stacks tracking.
///
/// Parameters:
/// - `maxDepth`: integer
pub const SET_ASYNC_CALL_STACK_DEPTH: &str = "Debugger.setAsyncCallStackDepth";

/// Replace previous blackbox execution contexts with passed ones. Forces
/// backend to skip stepping/pausing in scripts in these execution contexts.
/// VM will try to leave blackboxed script by performing 'step in' several
/// times, finally resorting to 'step out' if unsuccessful.
///
/// Experimental: may change without notice.
///
/// Parameters:
/// - `uniqueIds`: array
pub const SET_BLACKBOX_EXECUTION_CONTEXTS: &str = "Debugger.setBlackboxExecutionContexts";

/// Replace previous blackbox patterns with passed ones. Forces backend to
/// skip stepping/pausing in scripts with url matching one of the patterns. VM
/// will try to leave blackboxed script by performing 'step in' several times,
/// finally resorting to 'step out' if unsuccessful.
///
/// Experimental: may change without notice.
///
/// Parameters:
/// - `patterns`: array
/// - `skipAnonymous`: boolean (optional)
pub const SET_BLACKBOX_PATTERNS: &str = "Debugger.setBlackboxPatterns";

/// Makes backend skip steps in the script in blackboxed ranges. VM will try
/// leave blacklisted scripts by performing 'step in' several times, finally
/// resorting to 'step out' if unsuccessful. Positions array contains
/// positions where blackbox state is changed. First interval isn't
/// blackboxed. Array should be sorted.
///
/// Experimental: may change without notice.
///
/// Parameters:
/// - `scriptId`: Runtime.ScriptId
/// - `positions`: array
pub const SET_BLACKBOXED_RANGES: &str = "Debugger.setBlackboxedRanges";

/// Sets JavaScript breakpoint at a given location.
///
/// Parameters:
/// - `location`: Location
/// - `condition`: string (optional)
///
/// Returns: `breakpointId`, `actualLocation`
pub const SET_BREAKPOINT: &str = "Debugger.setBreakpoint";

/// Sets instrumentation breakpoint.
///
/// Parameters:
/// - `instrumentation`: string
///
/// Returns: `breakpointId`
pub const SET_INSTRUMENTATION_BREAKPOINT: &str = "Debugger.setInstrumentationBreakpoint";

/// Sets JavaScript breakpoint at given location specified either by URL or
/// URL regex. Once this command is issued, all existing parsed scripts will
/// have breakpoints resolved and returned in `locations` property. Further
/// matching script parsing will result in subsequent `breakpointResolved`
/// events issued. This logical breakpoint will survive page reloads.
///
/// Parameters:
/// - `lineNumber`: integer
/// - `url`: string (optional)
/// - `urlRegex`: string (optional)
/// - `scriptHash`: string (optional)
/// - `columnNumber`: integer (optional)
/// - `condition`: string (optional)
///
/// Returns: `breakpointId`, `locations`
pub const SET_BREAKPOINT_BY_URL: &str = "Debugger.setBreakpointByUrl";

/// Sets JavaScript breakpoint before each call to the given function. If
/// another function was created from the same source as a given one, calling
/// it will also trigger the breakpoint.
///
/// Experimental: may change without notice.
///
/// Parameters:
/// - `objectId`: Runtime.RemoteObjectId
/// - `condition`: string (optional)
///
/// Returns: `breakpointId`
pub const SET_BREAKPOINT_ON_FUNCTION_CALL: &str = "Debugger.setBreakpointOnFunctionCall";

/// Activates / deactivates all breakpoints on the page.
///
/// Parameters:
/// - `active`: boolean
pub const SET_BREAKPOINTS_ACTIVE: &str = "Debugger.setBreakpointsActive";

/// Defines pause on exceptions state. Can be set to stop on all exceptions,
/// uncaught exceptions, or caught exceptions, no exceptions. Initial pause on
/// exceptions state is `none`.
///
/// Parameters:
/// - `state`: string
pub const SET_PAUSE_ON_EXCEPTIONS: &str = "Debugger.setPauseOnExceptions";

/// Changes return value in top frame. Available only at return break
/// position.
///
/// Experimental: may change without notice.
///
/// Parameters:
/// - `newValue`: Runtime.CallArgument
pub const SET_RETURN_VALUE: &str = "Debugger.setReturnValue";

/// Edits JavaScript source live. In general, functions that are currently on
/// the stack can not be edited with a single exception: If the edited
/// function is the top-most stack frame and that is the only activation of
/// that function on the stack. In this case the live edit will be successful
/// and a `Debugger.restartFrame` for the top-most function is automatically
/// triggered.
///
/// Parameters:
/// - `scriptId`: Runtime.ScriptId
/// - `scriptSource`: string
/// - `dryRun`: boolean (optional)
/// - `allowTopFrameEditing`: boolean (optional)
///
/// Returns: `callFrames`, `stackChanged`, `asyncStackTrace`, `asyncStackTraceId`, `status`, `exceptionDetails`
pub const SET_SCRIPT_SOURCE: &str = "Debugger.setScriptSource";

/// Makes page not interrupt on any pauses (breakpoint, exception, dom
/// exception etc).
///
/// Parameters:
/// - `skip`: boolean
pub const SET_SKIP_ALL_PAUSES: &str = "Debugger.setSkipAllPauses";

/// Changes value of variable in a callframe. Object-based scopes are not
/// supported and must be mutated manually.
///
/// Parameters:
/// - `scopeNumber`: integer
/// - `variableName`: string
/// - `newValue`: Runtime.CallArgument
/// - `callFrameId`: CallFrameId
pub const SET_VARIABLE_VALUE: &str = "Debugger.setVariableValue";

/// Steps into the function call.
///
/// Parameters:
/// - `breakOnAsyncCall`: boolean (optional)
/// - `skipList`: array (optional)
pub const STEP_INTO: &str = "Debugger.stepInto";

/// Steps out of the function call.
pub const STEP_OUT: &str = "Debugger.stepOut";

/// Steps over the statement.
///
/// Parameters:
/// - `skipList`: array (optional)
pub const STEP_OVER: &str = "Debugger.stepOver";