Interface IDebugger
Debugger domain exposes JavaScript debugging capabilities. It allows setting and removing breakpoints, stepping through execution, exploring stack traces, etc.
public interface IDebugger
Properties
BreakpointResolved
Fired when breakpoint is resolved to an actual script and location. Deprecated in favor of resolvedBreakpoints in the scriptParsed event.
[Obsolete]
IEventSource<BreakpointResolvedEventArgs> BreakpointResolved { get; }
Property Value
- IEventSource<BreakpointResolvedEventArgs>
Remarks
Event args (BreakpointResolvedEventArgs):
- BreakpointId - Breakpoint unique identifier.
- Location - Actual breakpoint location.
Paused
Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria.
IEventSource<PausedEventArgs> Paused { get; }
Property Value
- IEventSource<PausedEventArgs>
Remarks
Event args (PausedEventArgs):
- CallFrames - Call stack the virtual machine stopped on.
- Reason - Pause reason.
- Data - Object containing break-specific auxiliary properties.
- HitBreakpoints - Hit breakpoints IDs
- AsyncStackTrace - Async stack trace, if any.
- AsyncStackTraceId - Async stack trace, if any.
- AsyncCallStackTraceId - Never present, will be removed.
Resumed
Fired when the virtual machine resumed execution.
IEventSource<ResumedEventArgs> Resumed { get; }
Property Value
- IEventSource<ResumedEventArgs>
ScriptFailedToParse
Fired when virtual machine fails to parse the script.
IEventSource<ScriptFailedToParseEventArgs> ScriptFailedToParse { get; }
Property Value
- IEventSource<ScriptFailedToParseEventArgs>
Remarks
Event args (ScriptFailedToParseEventArgs):
- ScriptId - Identifier of the script parsed.
- Url - URL or name of the script parsed (if any).
- StartLine - Line offset of the script within the resource with given URL (for script tags).
- StartColumn - Column offset of the script within the resource with given URL.
- EndLine - Last line of the script.
- EndColumn - Length of the last line of the script.
- ExecutionContextId - Specifies script creation context.
- Hash - Content hash of the script, SHA-256.
- BuildId - For Wasm modules, the content of the build_id custom section. For JavaScript the debugId magic comment.
- ExecutionContextAuxData - Embedder-specific auxiliary data likely matching {isDefault: boolean, type: 'default'|'isolated'|'worker', frameId: string}
- SourceMapURL - URL of source map associated with script (if any).
- HasSourceURL - True, if this script has sourceURL.
- IsModule - True, if this script is ES6 module.
- Length - This script length.
- StackTrace - JavaScript top stack frame of where the script parsed event was triggered if available.
- CodeOffset - If the scriptLanguage is WebAssembly, the code section offset in the module.
- ScriptLanguage - The language of the script.
- EmbedderName - The name the embedder supplied for this script.
ScriptParsed
Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger.
IEventSource<ScriptParsedEventArgs> ScriptParsed { get; }
Property Value
- IEventSource<ScriptParsedEventArgs>
Remarks
Event args (ScriptParsedEventArgs):
- ScriptId - Identifier of the script parsed.
- Url - URL or name of the script parsed (if any).
- StartLine - Line offset of the script within the resource with given URL (for script tags).
- StartColumn - Column offset of the script within the resource with given URL.
- EndLine - Last line of the script.
- EndColumn - Length of the last line of the script.
- ExecutionContextId - Specifies script creation context.
- Hash - Content hash of the script, SHA-256.
- BuildId - For Wasm modules, the content of the build_id custom section. For JavaScript the debugId magic comment.
- ExecutionContextAuxData - Embedder-specific auxiliary data likely matching {isDefault: boolean, type: 'default'|'isolated'|'worker', frameId: string}
- IsLiveEdit - True, if this script is generated as a result of the live edit operation.
- SourceMapURL - URL of source map associated with script (if any).
- HasSourceURL - True, if this script has sourceURL.
- IsModule - True, if this script is ES6 module.
- Length - This script length.
- StackTrace - JavaScript top stack frame of where the script parsed event was triggered if available.
- CodeOffset - If the scriptLanguage is WebAssembly, the code section offset in the module.
- ScriptLanguage - The language of the script.
- DebugSymbols - If the scriptLanguage is WebAssembly, the source of debug symbols for the module.
- EmbedderName - The name the embedder supplied for this script.
- ResolvedBreakpoints - The list of set breakpoints in this script if calls to setBreakpointByUrl matches this script's URL or hash. Clients that use this list can ignore the breakpointResolved event. They are equivalent.
Methods
ContinueToLocationAsync(Location, string?, string?, CancellationToken)
Continues execution until specific location is reached.
Task<ContinueToLocationResult> ContinueToLocationAsync(Location location, string? targetCallFrames = null, string? session = null, CancellationToken cancellationToken = default)
Parameters
locationLocationLocation to continue to.
targetCallFramesstringsessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<ContinueToLocationResult>
A task representing the asynchronous operation, containing a ContinueToLocationResult.
DisableAsync(string?, CancellationToken)
Disables debugger for given page.
Task<DisableResult> DisableAsync(string? session = null, CancellationToken cancellationToken = default)
Parameters
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<DisableResult>
A task representing the asynchronous operation, containing a DisableResult.
DisassembleWasmModuleAsync(ScriptId, string?, CancellationToken)
[Experimental("BIDICDP001")]
Task<DisassembleWasmModuleResult> DisassembleWasmModuleAsync(ScriptId scriptId, string? session = null, CancellationToken cancellationToken = default)
Parameters
scriptIdScriptIdId of the script to disassemble
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<DisassembleWasmModuleResult>
A task representing the asynchronous operation, containing a DisassembleWasmModuleResult.
EnableAsync(double?, string?, CancellationToken)
Enables debugger for the given page. Clients should not assume that the debugging has been enabled until the result for this command is received.
Task<EnableResult> EnableAsync(double? maxScriptsCacheSize = null, string? session = null, CancellationToken cancellationToken = default)
Parameters
maxScriptsCacheSizedouble?The maximum size in bytes of collected scripts (not referenced by other heap objects) the debugger can hold. Puts no limit if parameter is omitted.
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<EnableResult>
A task representing the asynchronous operation, containing a EnableResult.
EvaluateOnCallFrameAsync(CallFrameId, string, string?, bool?, bool?, bool?, bool?, bool?, TimeDelta?, long?, string?, CancellationToken)
Evaluates expression on a given call frame.
Task<EvaluateOnCallFrameResult> EvaluateOnCallFrameAsync(CallFrameId callFrameId, string expression, string? objectGroup = null, bool? includeCommandLineAPI = null, bool? silent = null, bool? returnByValue = null, bool? generatePreview = null, bool? throwOnSideEffect = null, TimeDelta? timeout = null, long? scopeNumber = null, string? session = null, CancellationToken cancellationToken = default)
Parameters
callFrameIdCallFrameIdCall frame identifier to evaluate on.
expressionstringExpression to evaluate.
objectGroupstringString object group name to put result into (allows rapid releasing resulting object handles using releaseObjectGroup).
includeCommandLineAPIbool?Specifies whether command line API should be available to the evaluated expression, defaults to false.
silentbool?In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state.
returnByValuebool?Whether the result is expected to be a JSON object that should be sent by value.
generatePreviewbool?Whether preview should be generated for the result.
throwOnSideEffectbool?Whether to throw an exception if side effect cannot be ruled out during evaluation.
timeoutTimeDeltaTerminate execution after timing out (number of milliseconds).
scopeNumberlong?Specifies the scope number to evaluate the expression in (default: 0, innermost scope).
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<EvaluateOnCallFrameResult>
A task representing the asynchronous operation, containing a EvaluateOnCallFrameResult.
GetPossibleBreakpointsAsync(Location, Location?, bool?, string?, CancellationToken)
Returns possible locations for breakpoint. scriptId in start and end range locations should be the same.
Task<GetPossibleBreakpointsResult> GetPossibleBreakpointsAsync(Location start, Location? end = null, bool? restrictToFunction = null, string? session = null, CancellationToken cancellationToken = default)
Parameters
startLocationStart of range to search possible breakpoint locations in.
endLocationEnd of range to search possible breakpoint locations in (excluding). When not specified, end of scripts is used as end of range.
restrictToFunctionbool?Only consider locations which are in the same (non-nested) function as start.
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<GetPossibleBreakpointsResult>
A task representing the asynchronous operation, containing a GetPossibleBreakpointsResult.
GetScriptSourceAsync(ScriptId, string?, CancellationToken)
Returns source for the script with given id.
Task<GetScriptSourceResult> GetScriptSourceAsync(ScriptId scriptId, string? session = null, CancellationToken cancellationToken = default)
Parameters
scriptIdScriptIdId of the script to get source for.
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<GetScriptSourceResult>
A task representing the asynchronous operation, containing a GetScriptSourceResult.
GetStackTraceAsync(StackTraceId, string?, CancellationToken)
Returns stack trace with given stackTraceId.
[Experimental("BIDICDP001")]
Task<GetStackTraceResult> GetStackTraceAsync(StackTraceId stackTraceId, string? session = null, CancellationToken cancellationToken = default)
Parameters
stackTraceIdStackTraceIdsessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<GetStackTraceResult>
A task representing the asynchronous operation, containing a GetStackTraceResult.
GetWasmBytecodeAsync(ScriptId, string?, CancellationToken)
This command is deprecated. Use getScriptSource instead.
[Obsolete]
Task<GetWasmBytecodeResult> GetWasmBytecodeAsync(ScriptId scriptId, string? session = null, CancellationToken cancellationToken = default)
Parameters
scriptIdScriptIdId of the Wasm script to get source for.
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<GetWasmBytecodeResult>
A task representing the asynchronous operation, containing a GetWasmBytecodeResult.
NextWasmDisassemblyChunkAsync(string, string?, CancellationToken)
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("BIDICDP001")]
Task<NextWasmDisassemblyChunkResult> NextWasmDisassemblyChunkAsync(string streamId, string? session = null, CancellationToken cancellationToken = default)
Parameters
streamIdstringsessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<NextWasmDisassemblyChunkResult>
A task representing the asynchronous operation, containing a NextWasmDisassemblyChunkResult.
PauseAsync(string?, CancellationToken)
Stops on the next JavaScript statement.
Task<PauseResult> PauseAsync(string? session = null, CancellationToken cancellationToken = default)
Parameters
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<PauseResult>
A task representing the asynchronous operation, containing a PauseResult.
PauseOnAsyncCallAsync(StackTraceId, string?, CancellationToken)
[Experimental("BIDICDP001")]
[Obsolete]
Task<PauseOnAsyncCallResult> PauseOnAsyncCallAsync(StackTraceId parentStackTraceId, string? session = null, CancellationToken cancellationToken = default)
Parameters
parentStackTraceIdStackTraceIdDebugger will pause when async call with given stack trace is started.
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<PauseOnAsyncCallResult>
A task representing the asynchronous operation, containing a PauseOnAsyncCallResult.
RemoveBreakpointAsync(BreakpointId, string?, CancellationToken)
Removes JavaScript breakpoint.
Task<RemoveBreakpointResult> RemoveBreakpointAsync(BreakpointId breakpointId, string? session = null, CancellationToken cancellationToken = default)
Parameters
breakpointIdBreakpointIdsessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<RemoveBreakpointResult>
A task representing the asynchronous operation, containing a RemoveBreakpointResult.
RestartFrameAsync(CallFrameId, string?, string?, CancellationToken)
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.
Task<RestartFrameResult> RestartFrameAsync(CallFrameId callFrameId, string? mode = null, string? session = null, CancellationToken cancellationToken = default)
Parameters
callFrameIdCallFrameIdCall frame identifier to evaluate on.
modestringThe mode parameter must be present and set to 'StepInto', otherwise restartFrame will error out.
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<RestartFrameResult>
A task representing the asynchronous operation, containing a RestartFrameResult.
ResumeAsync(bool?, string?, CancellationToken)
Resumes JavaScript execution.
Task<ResumeResult> ResumeAsync(bool? terminateOnResume = null, string? session = null, CancellationToken cancellationToken = default)
Parameters
terminateOnResumebool?Set to true to terminate execution upon resuming execution. In contrast to Runtime.terminateExecution, this will allows to execute further JavaScript (i.e. via evaluation) until execution of the paused code is actually resumed, at which point termination is triggered. If execution is currently not paused, this parameter has no effect.
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<ResumeResult>
A task representing the asynchronous operation, containing a ResumeResult.
SearchInContentAsync(ScriptId, string, bool?, bool?, string?, CancellationToken)
Searches for given string in script content.
Task<SearchInContentResult> SearchInContentAsync(ScriptId scriptId, string query, bool? caseSensitive = null, bool? isRegex = null, string? session = null, CancellationToken cancellationToken = default)
Parameters
scriptIdScriptIdId of the script to search in.
querystringString to search for.
caseSensitivebool?If true, search is case sensitive.
isRegexbool?If true, treats string parameter as regex.
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<SearchInContentResult>
A task representing the asynchronous operation, containing a SearchInContentResult.
SetAsyncCallStackDepthAsync(long, string?, CancellationToken)
Enables or disables async call stacks tracking.
Task<SetAsyncCallStackDepthResult> SetAsyncCallStackDepthAsync(long maxDepth, string? session = null, CancellationToken cancellationToken = default)
Parameters
maxDepthlongMaximum depth of async call stacks. Setting to 0 will effectively disable collecting async call stacks (default).
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<SetAsyncCallStackDepthResult>
A task representing the asynchronous operation, containing a SetAsyncCallStackDepthResult.
SetBlackboxExecutionContextsAsync(ImmutableArray<string>, string?, CancellationToken)
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("BIDICDP001")]
Task<SetBlackboxExecutionContextsResult> SetBlackboxExecutionContextsAsync(ImmutableArray<string> uniqueIds, string? session = null, CancellationToken cancellationToken = default)
Parameters
uniqueIdsImmutableArray<string>Array of execution context unique ids for the debugger to ignore.
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<SetBlackboxExecutionContextsResult>
A task representing the asynchronous operation, containing a SetBlackboxExecutionContextsResult.
SetBlackboxPatternsAsync(ImmutableArray<string>, bool?, string?, CancellationToken)
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("BIDICDP001")]
Task<SetBlackboxPatternsResult> SetBlackboxPatternsAsync(ImmutableArray<string> patterns, bool? skipAnonymous = null, string? session = null, CancellationToken cancellationToken = default)
Parameters
patternsImmutableArray<string>Array of regexps that will be used to check script url for blackbox state.
skipAnonymousbool?If true, also ignore scripts with no source url.
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<SetBlackboxPatternsResult>
A task representing the asynchronous operation, containing a SetBlackboxPatternsResult.
SetBlackboxedRangesAsync(ScriptId, ImmutableArray<ScriptPosition>, string?, CancellationToken)
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("BIDICDP001")]
Task<SetBlackboxedRangesResult> SetBlackboxedRangesAsync(ScriptId scriptId, ImmutableArray<ScriptPosition> positions, string? session = null, CancellationToken cancellationToken = default)
Parameters
scriptIdScriptIdId of the script.
positionsImmutableArray<ScriptPosition>sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<SetBlackboxedRangesResult>
A task representing the asynchronous operation, containing a SetBlackboxedRangesResult.
SetBreakpointAsync(Location, string?, string?, CancellationToken)
Sets JavaScript breakpoint at a given location.
Task<SetBreakpointResult> SetBreakpointAsync(Location location, string? condition = null, string? session = null, CancellationToken cancellationToken = default)
Parameters
locationLocationLocation to set breakpoint in.
conditionstringExpression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true.
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<SetBreakpointResult>
A task representing the asynchronous operation, containing a SetBreakpointResult.
SetBreakpointByUrlAsync(long, string?, string?, string?, long?, string?, string?, CancellationToken)
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.
Task<SetBreakpointByUrlResult> SetBreakpointByUrlAsync(long lineNumber, string? url = null, string? urlRegex = null, string? scriptHash = null, long? columnNumber = null, string? condition = null, string? session = null, CancellationToken cancellationToken = default)
Parameters
lineNumberlongLine number to set breakpoint at.
urlstringURL of the resources to set breakpoint on.
urlRegexstringRegex pattern for the URLs of the resources to set breakpoints on. Either url or urlRegex must be specified.
scriptHashstringScript hash of the resources to set breakpoint on.
columnNumberlong?Offset in the line to set breakpoint at.
conditionstringExpression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true.
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<SetBreakpointByUrlResult>
A task representing the asynchronous operation, containing a SetBreakpointByUrlResult.
SetBreakpointOnFunctionCallAsync(RemoteObjectId, string?, string?, CancellationToken)
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("BIDICDP001")]
Task<SetBreakpointOnFunctionCallResult> SetBreakpointOnFunctionCallAsync(RemoteObjectId objectId, string? condition = null, string? session = null, CancellationToken cancellationToken = default)
Parameters
objectIdRemoteObjectIdFunction object id.
conditionstringExpression to use as a breakpoint condition. When specified, debugger will stop on the breakpoint if this expression evaluates to true.
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<SetBreakpointOnFunctionCallResult>
A task representing the asynchronous operation, containing a SetBreakpointOnFunctionCallResult.
SetBreakpointsActiveAsync(bool, string?, CancellationToken)
Activates / deactivates all breakpoints on the page.
Task<SetBreakpointsActiveResult> SetBreakpointsActiveAsync(bool active, string? session = null, CancellationToken cancellationToken = default)
Parameters
activeboolNew value for breakpoints active state.
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<SetBreakpointsActiveResult>
A task representing the asynchronous operation, containing a SetBreakpointsActiveResult.
SetInstrumentationBreakpointAsync(string, string?, CancellationToken)
Sets instrumentation breakpoint.
Task<SetInstrumentationBreakpointResult> SetInstrumentationBreakpointAsync(string instrumentation, string? session = null, CancellationToken cancellationToken = default)
Parameters
instrumentationstringInstrumentation name.
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<SetInstrumentationBreakpointResult>
A task representing the asynchronous operation, containing a SetInstrumentationBreakpointResult.
SetPauseOnExceptionsAsync(string, string?, CancellationToken)
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.
Task<SetPauseOnExceptionsResult> SetPauseOnExceptionsAsync(string state, string? session = null, CancellationToken cancellationToken = default)
Parameters
statestringPause on exceptions mode.
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<SetPauseOnExceptionsResult>
A task representing the asynchronous operation, containing a SetPauseOnExceptionsResult.
SetReturnValueAsync(CallArgument, string?, CancellationToken)
Changes return value in top frame. Available only at return break position.
[Experimental("BIDICDP001")]
Task<SetReturnValueResult> SetReturnValueAsync(CallArgument newValue, string? session = null, CancellationToken cancellationToken = default)
Parameters
newValueCallArgumentNew return value.
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<SetReturnValueResult>
A task representing the asynchronous operation, containing a SetReturnValueResult.
SetScriptSourceAsync(ScriptId, string, bool?, bool?, string?, CancellationToken)
Live edit is no longer supported and this command always fails with a "no longer available" error.
[Obsolete]
Task<SetScriptSourceResult> SetScriptSourceAsync(ScriptId scriptId, string scriptSource, bool? dryRun = null, bool? allowTopFrameEditing = null, string? session = null, CancellationToken cancellationToken = default)
Parameters
scriptIdScriptIdId of the script to edit.
scriptSourcestringNew content of the script.
dryRunbool?If true the change will not actually be applied. Dry run may be used to get result description without actually modifying the code.
allowTopFrameEditingbool?If true, then scriptSource is allowed to change the function on top of the stack as long as the top-most stack frame is the only activation of that function.
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<SetScriptSourceResult>
A task representing the asynchronous operation, containing a SetScriptSourceResult.
SetSkipAllPausesAsync(bool, string?, CancellationToken)
Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc).
Task<SetSkipAllPausesResult> SetSkipAllPausesAsync(bool skip, string? session = null, CancellationToken cancellationToken = default)
Parameters
skipboolNew value for skip pauses state.
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<SetSkipAllPausesResult>
A task representing the asynchronous operation, containing a SetSkipAllPausesResult.
SetVariableValueAsync(long, string, CallArgument, CallFrameId, string?, CancellationToken)
Changes value of variable in a callframe. Object-based scopes are not supported and must be mutated manually.
Task<SetVariableValueResult> SetVariableValueAsync(long scopeNumber, string variableName, CallArgument newValue, CallFrameId callFrameId, string? session = null, CancellationToken cancellationToken = default)
Parameters
scopeNumberlong0-based number of scope as was listed in scope chain. Only 'local', 'closure' and 'catch' scope types are allowed. Other scopes could be manipulated manually.
variableNamestringVariable name.
newValueCallArgumentNew variable value.
callFrameIdCallFrameIdId of callframe that holds variable.
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<SetVariableValueResult>
A task representing the asynchronous operation, containing a SetVariableValueResult.
StepIntoAsync(bool?, ImmutableArray<LocationRange>?, string?, CancellationToken)
Steps into the function call.
Task<StepIntoResult> StepIntoAsync(bool? breakOnAsyncCall = null, ImmutableArray<LocationRange>? skipList = null, string? session = null, CancellationToken cancellationToken = default)
Parameters
breakOnAsyncCallbool?Debugger will pause on the execution of the first async task which was scheduled before next pause.
skipListImmutableArray<LocationRange>?The skipList specifies location ranges that should be skipped on step into.
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<StepIntoResult>
A task representing the asynchronous operation, containing a StepIntoResult.
StepOutAsync(string?, CancellationToken)
Steps out of the function call.
Task<StepOutResult> StepOutAsync(string? session = null, CancellationToken cancellationToken = default)
Parameters
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<StepOutResult>
A task representing the asynchronous operation, containing a StepOutResult.
StepOverAsync(ImmutableArray<LocationRange>?, string?, CancellationToken)
Steps over the statement.
Task<StepOverResult> StepOverAsync(ImmutableArray<LocationRange>? skipList = null, string? session = null, CancellationToken cancellationToken = default)
Parameters
skipListImmutableArray<LocationRange>?The skipList specifies location ranges that should be skipped on step over.
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<StepOverResult>
A task representing the asynchronous operation, containing a StepOverResult.