debugger
BreakLocation
dataclass
Source code in zendriver/cdp/debugger.py
column_number: typing.Optional[int] = None
class-attribute
instance-attribute
line_number: int
instance-attribute
script_id: runtime.ScriptId
instance-attribute
type_: typing.Optional[str] = None
class-attribute
instance-attribute
__init__(script_id, line_number, column_number=None, type_=None)
from_json(json)
classmethod
Source code in zendriver/cdp/debugger.py
to_json()
Source code in zendriver/cdp/debugger.py
BreakpointId
Bases: str
Breakpoint identifier.
Source code in zendriver/cdp/debugger.py
__repr__()
from_json(json)
classmethod
BreakpointResolved
dataclass
Fired when breakpoint is resolved to an actual script and location.
Source code in zendriver/cdp/debugger.py
breakpoint_id: BreakpointId
instance-attribute
location: Location
instance-attribute
__init__(breakpoint_id, location)
CallFrame
dataclass
JavaScript call frame. Array of call frames form the call stack.
Source code in zendriver/cdp/debugger.py
call_frame_id: CallFrameId
instance-attribute
can_be_restarted: typing.Optional[bool] = None
class-attribute
instance-attribute
function_location: typing.Optional[Location] = None
class-attribute
instance-attribute
function_name: str
instance-attribute
location: Location
instance-attribute
return_value: typing.Optional[runtime.RemoteObject] = None
class-attribute
instance-attribute
scope_chain: typing.List[Scope]
instance-attribute
this: runtime.RemoteObject
instance-attribute
url: str
instance-attribute
__init__(call_frame_id, function_name, location, url, scope_chain, this, function_location=None, return_value=None, can_be_restarted=None)
from_json(json)
classmethod
Source code in zendriver/cdp/debugger.py
to_json()
Source code in zendriver/cdp/debugger.py
CallFrameId
Bases: str
Call frame identifier.
Source code in zendriver/cdp/debugger.py
__repr__()
from_json(json)
classmethod
DebugSymbols
dataclass
Debug symbols available for a wasm script.
Source code in zendriver/cdp/debugger.py
external_url: typing.Optional[str] = None
class-attribute
instance-attribute
type_: str
instance-attribute
__init__(type_, external_url=None)
from_json(json)
classmethod
Location
dataclass
Location in the source code.
Source code in zendriver/cdp/debugger.py
column_number: typing.Optional[int] = None
class-attribute
instance-attribute
line_number: int
instance-attribute
script_id: runtime.ScriptId
instance-attribute
__init__(script_id, line_number, column_number=None)
from_json(json)
classmethod
Source code in zendriver/cdp/debugger.py
to_json()
LocationRange
dataclass
Location range within one script.
Source code in zendriver/cdp/debugger.py
end: ScriptPosition
instance-attribute
script_id: runtime.ScriptId
instance-attribute
start: ScriptPosition
instance-attribute
__init__(script_id, start, end)
from_json(json)
classmethod
Paused
dataclass
Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria.
Source code in zendriver/cdp/debugger.py
async_call_stack_trace_id: typing.Optional[runtime.StackTraceId]
instance-attribute
async_stack_trace: typing.Optional[runtime.StackTrace]
instance-attribute
async_stack_trace_id: typing.Optional[runtime.StackTraceId]
instance-attribute
call_frames: typing.List[CallFrame]
instance-attribute
data: typing.Optional[dict]
instance-attribute
hit_breakpoints: typing.Optional[typing.List[str]]
instance-attribute
reason: str
instance-attribute
__init__(call_frames, reason, data, hit_breakpoints, async_stack_trace, async_stack_trace_id, async_call_stack_trace_id)
from_json(json)
classmethod
Source code in zendriver/cdp/debugger.py
Resumed
dataclass
Fired when the virtual machine resumed execution.
Source code in zendriver/cdp/debugger.py
Scope
dataclass
Scope description.
Source code in zendriver/cdp/debugger.py
end_location: typing.Optional[Location] = None
class-attribute
instance-attribute
name: typing.Optional[str] = None
class-attribute
instance-attribute
object_: runtime.RemoteObject
instance-attribute
start_location: typing.Optional[Location] = None
class-attribute
instance-attribute
type_: str
instance-attribute
__init__(type_, object_, name=None, start_location=None, end_location=None)
from_json(json)
classmethod
Source code in zendriver/cdp/debugger.py
to_json()
Source code in zendriver/cdp/debugger.py
ScriptFailedToParse
dataclass
Fired when virtual machine fails to parse the script.
Source code in zendriver/cdp/debugger.py
1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 |
|
code_offset: typing.Optional[int]
instance-attribute
embedder_name: typing.Optional[str]
instance-attribute
end_column: int
instance-attribute
end_line: int
instance-attribute
execution_context_aux_data: typing.Optional[dict]
instance-attribute
execution_context_id: runtime.ExecutionContextId
instance-attribute
has_source_url: typing.Optional[bool]
instance-attribute
hash_: str
instance-attribute
is_module: typing.Optional[bool]
instance-attribute
length: typing.Optional[int]
instance-attribute
script_id: runtime.ScriptId
instance-attribute
script_language: typing.Optional[ScriptLanguage]
instance-attribute
source_map_url: typing.Optional[str]
instance-attribute
stack_trace: typing.Optional[runtime.StackTrace]
instance-attribute
start_column: int
instance-attribute
start_line: int
instance-attribute
url: str
instance-attribute
__init__(script_id, url, start_line, start_column, end_line, end_column, execution_context_id, hash_, execution_context_aux_data, source_map_url, has_source_url, is_module, length, stack_trace, code_offset, script_language, embedder_name)
from_json(json)
classmethod
Source code in zendriver/cdp/debugger.py
ScriptLanguage
Bases: Enum
Enum of possible script languages.
Source code in zendriver/cdp/debugger.py
JAVA_SCRIPT = 'JavaScript'
class-attribute
instance-attribute
WEB_ASSEMBLY = 'WebAssembly'
class-attribute
instance-attribute
from_json(json)
classmethod
ScriptParsed
dataclass
Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger.
Source code in zendriver/cdp/debugger.py
1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 |
|
code_offset: typing.Optional[int]
instance-attribute
debug_symbols: typing.Optional[typing.List[DebugSymbols]]
instance-attribute
embedder_name: typing.Optional[str]
instance-attribute
end_column: int
instance-attribute
end_line: int
instance-attribute
execution_context_aux_data: typing.Optional[dict]
instance-attribute
execution_context_id: runtime.ExecutionContextId
instance-attribute
has_source_url: typing.Optional[bool]
instance-attribute
hash_: str
instance-attribute
is_live_edit: typing.Optional[bool]
instance-attribute
is_module: typing.Optional[bool]
instance-attribute
length: typing.Optional[int]
instance-attribute
script_id: runtime.ScriptId
instance-attribute
script_language: typing.Optional[ScriptLanguage]
instance-attribute
source_map_url: typing.Optional[str]
instance-attribute
stack_trace: typing.Optional[runtime.StackTrace]
instance-attribute
start_column: int
instance-attribute
start_line: int
instance-attribute
url: str
instance-attribute
__init__(script_id, url, start_line, start_column, end_line, end_column, execution_context_id, hash_, execution_context_aux_data, is_live_edit, source_map_url, has_source_url, is_module, length, stack_trace, code_offset, script_language, debug_symbols, embedder_name)
from_json(json)
classmethod
Source code in zendriver/cdp/debugger.py
ScriptPosition
dataclass
Location in the source code.
Source code in zendriver/cdp/debugger.py
column_number: int
instance-attribute
line_number: int
instance-attribute
__init__(line_number, column_number)
from_json(json)
classmethod
SearchMatch
dataclass
Search match for resource.
Source code in zendriver/cdp/debugger.py
line_content: str
instance-attribute
line_number: float
instance-attribute
__init__(line_number, line_content)
from_json(json)
classmethod
WasmDisassemblyChunk
dataclass
Source code in zendriver/cdp/debugger.py
bytecode_offsets: typing.List[int]
instance-attribute
lines: typing.List[str]
instance-attribute
__init__(lines, bytecode_offsets)
from_json(json)
classmethod
continue_to_location(location, target_call_frames=None)
Continues execution until specific location is reached.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
location
|
Location
|
Location to continue to. |
required |
target_call_frames
|
Optional[str]
|
(Optional) |
None
|
Source code in zendriver/cdp/debugger.py
disable()
disassemble_wasm_module(script_id)
EXPERIMENTAL
Parameters:
Name | Type | Description | Default |
---|---|---|---|
script_id
|
ScriptId
|
Id of the script to disassemble |
required |
Returns:
Type | Description |
---|---|
Generator[T_JSON_DICT, T_JSON_DICT, Tuple[Optional[str], int, List[int], WasmDisassemblyChunk]]
|
A tuple with the following items: 0. streamId - (Optional) For large modules, return a stream from which additional chunks of disassembly can be read successively. 1. totalNumberOfLines - The total number of lines in the disassembly text. 2. functionBodyOffsets - The offsets of all function bodies, in the format [start1, end1, start2, end2, ...] where all ends are exclusive. 3. chunk - The first chunk of disassembly. |
Source code in zendriver/cdp/debugger.py
enable(max_scripts_cache_size=None)
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:
Name | Type | Description | Default |
---|---|---|---|
max_scripts_cache_size
|
Optional[float]
|
(EXPERIMENTAL) (Optional) 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. |
None
|
Returns:
Type | Description |
---|---|
Generator[T_JSON_DICT, T_JSON_DICT, UniqueDebuggerId]
|
Unique identifier of the debugger. |
Source code in zendriver/cdp/debugger.py
evaluate_on_call_frame(call_frame_id, expression, object_group=None, include_command_line_api=None, silent=None, return_by_value=None, generate_preview=None, throw_on_side_effect=None, timeout=None)
Evaluates expression on a given call frame.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
call_frame_id
|
CallFrameId
|
Call frame identifier to evaluate on. |
required |
expression
|
str
|
Expression to evaluate. |
required |
object_group
|
Optional[str]
|
(Optional) String object group name to put result into (allows rapid releasing resulting object handles using ```releaseObjectGroup````). |
None
|
include_command_line_api
|
Optional[bool]
|
(Optional) Specifies whether command line API should be available to the evaluated expression, defaults to false. |
None
|
silent
|
Optional[bool]
|
(Optional) In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides |
None
|
return_by_value
|
Optional[bool]
|
(Optional) Whether the result is expected to be a JSON object that should be sent by value. |
None
|
generate_preview
|
Optional[bool]
|
(EXPERIMENTAL) (Optional) Whether preview should be generated for the result. |
None
|
throw_on_side_effect
|
Optional[bool]
|
(Optional) Whether to throw an exception if side effect cannot be ruled out during evaluation. |
None
|
timeout
|
Optional[TimeDelta]
|
(EXPERIMENTAL) (Optional) Terminate execution after timing out (number of milliseconds). |
None
|
Returns:
Type | Description |
---|---|
Generator[T_JSON_DICT, T_JSON_DICT, Tuple[RemoteObject, Optional[ExceptionDetails]]]
|
A tuple with the following items: 0. result - Object wrapper for the evaluation result. 1. exceptionDetails - (Optional) Exception details. |
Source code in zendriver/cdp/debugger.py
get_possible_breakpoints(start, end=None, restrict_to_function=None)
Returns possible locations for breakpoint. scriptId in start and end range locations should be the same.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
start
|
Location
|
Start of range to search possible breakpoint locations in. |
required |
end
|
Optional[Location]
|
(Optional) End of range to search possible breakpoint locations in (excluding). When not specified, end of scripts is used as end of range. |
None
|
restrict_to_function
|
Optional[bool]
|
(Optional) Only consider locations which are in the same (non-nested) function as start. |
None
|
Returns:
Type | Description |
---|---|
Generator[T_JSON_DICT, T_JSON_DICT, List[BreakLocation]]
|
List of the possible breakpoint locations. |
Source code in zendriver/cdp/debugger.py
get_script_source(script_id)
Returns source for the script with given id.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
script_id
|
ScriptId
|
Id of the script to get source for. |
required |
Returns:
Type | Description |
---|---|
Generator[T_JSON_DICT, T_JSON_DICT, Tuple[str, Optional[str]]]
|
A tuple with the following items: 0. scriptSource - Script source (empty in case of Wasm bytecode). 1. bytecode - (Optional) Wasm bytecode. (Encoded as a base64 string when passed over JSON) |
Source code in zendriver/cdp/debugger.py
get_stack_trace(stack_trace_id)
Returns stack trace with given stackTraceId
.
EXPERIMENTAL
Parameters:
Name | Type | Description | Default |
---|---|---|---|
stack_trace_id
|
StackTraceId
|
|
required |
Returns:
Type | Description |
---|---|
Generator[T_JSON_DICT, T_JSON_DICT, StackTrace]
|
|
Source code in zendriver/cdp/debugger.py
get_wasm_bytecode(script_id)
This command is deprecated. Use getScriptSource instead.
.. deprecated:: 1.3
Parameters:
Name | Type | Description | Default |
---|---|---|---|
script_id
|
ScriptId
|
Id of the Wasm script to get source for. |
required |
Returns:
Type | Description |
---|---|
Generator[T_JSON_DICT, T_JSON_DICT, str]
|
Script source. (Encoded as a base64 string when passed over JSON) |
Source code in zendriver/cdp/debugger.py
next_wasm_disassembly_chunk(stream_id)
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
Parameters:
Name | Type | Description | Default |
---|---|---|---|
stream_id
|
str
|
|
required |
Returns:
Type | Description |
---|---|
Generator[T_JSON_DICT, T_JSON_DICT, WasmDisassemblyChunk]
|
The next chunk of disassembly. |
Source code in zendriver/cdp/debugger.py
pause()
Stops on the next JavaScript statement.
pause_on_async_call(parent_stack_trace_id)
.. deprecated:: 1.3
EXPERIMENTAL
Parameters:
Name | Type | Description | Default |
---|---|---|---|
parent_stack_trace_id
|
StackTraceId
|
Debugger will pause when async call with given stack trace is started. |
required |
Source code in zendriver/cdp/debugger.py
remove_breakpoint(breakpoint_id)
Removes JavaScript breakpoint.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
breakpoint_id
|
BreakpointId
|
|
required |
Source code in zendriver/cdp/debugger.py
restart_frame(call_frame_id, mode=None)
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:
Name | Type | Description | Default |
---|---|---|---|
call_frame_id
|
CallFrameId
|
Call frame identifier to evaluate on. |
required |
mode
|
Optional[str]
|
(EXPERIMENTAL) (Optional) The |
None
|
Returns:
Type | Description |
---|---|
Generator[T_JSON_DICT, T_JSON_DICT, Tuple[List[CallFrame], Optional[StackTrace], Optional[StackTraceId]]]
|
A tuple with the following items: 0. callFrames - New stack trace. 1. asyncStackTrace - (Optional) Async stack trace, if any. 2. asyncStackTraceId - (Optional) Async stack trace, if any. |
Source code in zendriver/cdp/debugger.py
resume(terminate_on_resume=None)
Resumes JavaScript execution.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
terminate_on_resume
|
Optional[bool]
|
(Optional) 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. |
None
|
Source code in zendriver/cdp/debugger.py
search_in_content(script_id, query, case_sensitive=None, is_regex=None)
Searches for given string in script content.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
script_id
|
ScriptId
|
Id of the script to search in. |
required |
query
|
str
|
String to search for. |
required |
case_sensitive
|
Optional[bool]
|
(Optional) If true, search is case sensitive. |
None
|
is_regex
|
Optional[bool]
|
(Optional) If true, treats string parameter as regex. |
None
|
Returns:
Type | Description |
---|---|
Generator[T_JSON_DICT, T_JSON_DICT, List[SearchMatch]]
|
List of search matches. |
Source code in zendriver/cdp/debugger.py
set_async_call_stack_depth(max_depth)
Enables or disables async call stacks tracking.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
max_depth
|
int
|
Maximum depth of async call stacks. Setting to |
required |
Source code in zendriver/cdp/debugger.py
set_blackbox_execution_contexts(unique_ids)
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
Parameters:
Name | Type | Description | Default |
---|---|---|---|
unique_ids
|
List[str]
|
Array of execution context unique ids for the debugger to ignore. |
required |
Source code in zendriver/cdp/debugger.py
set_blackbox_patterns(patterns, skip_anonymous=None)
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
Parameters:
Name | Type | Description | Default |
---|---|---|---|
patterns
|
List[str]
|
Array of regexps that will be used to check script url for blackbox state. |
required |
skip_anonymous
|
Optional[bool]
|
(Optional) If true, also ignore scripts with no source url. |
None
|
Source code in zendriver/cdp/debugger.py
set_blackboxed_ranges(script_id, positions)
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
Parameters:
Name | Type | Description | Default |
---|---|---|---|
script_id
|
ScriptId
|
Id of the script. |
required |
positions
|
List[ScriptPosition]
|
|
required |
Source code in zendriver/cdp/debugger.py
set_breakpoint(location, condition=None)
Sets JavaScript breakpoint at a given location.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
location
|
Location
|
Location to set breakpoint in. |
required |
condition
|
Optional[str]
|
(Optional) Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true. |
None
|
Returns:
Type | Description |
---|---|
Generator[T_JSON_DICT, T_JSON_DICT, Tuple[BreakpointId, Location]]
|
A tuple with the following items: 0. breakpointId - Id of the created breakpoint for further reference. 1. actualLocation - Location this breakpoint resolved into. |
Source code in zendriver/cdp/debugger.py
set_breakpoint_by_url(line_number, url=None, url_regex=None, script_hash=None, column_number=None, condition=None)
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:
Name | Type | Description | Default |
---|---|---|---|
line_number
|
int
|
Line number to set breakpoint at. |
required |
url
|
Optional[str]
|
(Optional) URL of the resources to set breakpoint on. |
None
|
url_regex
|
Optional[str]
|
(Optional) Regex pattern for the URLs of the resources to set breakpoints on. Either |
None
|
script_hash
|
Optional[str]
|
(Optional) Script hash of the resources to set breakpoint on. |
None
|
column_number
|
Optional[int]
|
(Optional) Offset in the line to set breakpoint at. |
None
|
condition
|
Optional[str]
|
(Optional) Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true. |
None
|
Returns:
Type | Description |
---|---|
Generator[T_JSON_DICT, T_JSON_DICT, Tuple[BreakpointId, List[Location]]]
|
A tuple with the following items: 0. breakpointId - Id of the created breakpoint for further reference. 1. locations - List of the locations this breakpoint resolved into upon addition. |
Source code in zendriver/cdp/debugger.py
set_breakpoint_on_function_call(object_id, condition=None)
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
Parameters:
Name | Type | Description | Default |
---|---|---|---|
object_id
|
RemoteObjectId
|
Function object id. |
required |
condition
|
Optional[str]
|
(Optional) Expression to use as a breakpoint condition. When specified, debugger will stop on the breakpoint if this expression evaluates to true. |
None
|
Returns:
Type | Description |
---|---|
Generator[T_JSON_DICT, T_JSON_DICT, BreakpointId]
|
Id of the created breakpoint for further reference. |
Source code in zendriver/cdp/debugger.py
set_breakpoints_active(active)
Activates / deactivates all breakpoints on the page.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
active
|
bool
|
New value for breakpoints active state. |
required |
Source code in zendriver/cdp/debugger.py
set_instrumentation_breakpoint(instrumentation)
Sets instrumentation breakpoint.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
instrumentation
|
str
|
Instrumentation name. |
required |
Returns:
Type | Description |
---|---|
Generator[T_JSON_DICT, T_JSON_DICT, BreakpointId]
|
Id of the created breakpoint for further reference. |
Source code in zendriver/cdp/debugger.py
set_pause_on_exceptions(state)
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:
Name | Type | Description | Default |
---|---|---|---|
state
|
str
|
Pause on exceptions mode. |
required |
Source code in zendriver/cdp/debugger.py
set_return_value(new_value)
Changes return value in top frame. Available only at return break position.
EXPERIMENTAL
Parameters:
Name | Type | Description | Default |
---|---|---|---|
new_value
|
CallArgument
|
New return value. |
required |
Source code in zendriver/cdp/debugger.py
set_script_source(script_id, script_source, dry_run=None, allow_top_frame_editing=None)
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:
Name | Type | Description | Default |
---|---|---|---|
script_id
|
ScriptId
|
Id of the script to edit. |
required |
script_source
|
str
|
New content of the script. |
required |
dry_run
|
Optional[bool]
|
(Optional) If true the change will not actually be applied. Dry run may be used to get result description without actually modifying the code. |
None
|
allow_top_frame_editing
|
Optional[bool]
|
(EXPERIMENTAL) (Optional) 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. |
None
|
Returns:
Type | Description |
---|---|
Generator[T_JSON_DICT, T_JSON_DICT, Tuple[Optional[List[CallFrame]], Optional[bool], Optional[StackTrace], Optional[StackTraceId], str, Optional[ExceptionDetails]]]
|
A tuple with the following items: 0. callFrames - (Optional) New stack trace in case editing has happened while VM was stopped. 1. stackChanged - (Optional) Whether current call stack was modified after applying the changes. 2. asyncStackTrace - (Optional) Async stack trace, if any. 3. asyncStackTraceId - (Optional) Async stack trace, if any. 4. status - Whether the operation was successful or not. Only |
Source code in zendriver/cdp/debugger.py
1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 |
|
set_skip_all_pauses(skip)
Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
skip
|
bool
|
New value for skip pauses state. |
required |
Source code in zendriver/cdp/debugger.py
set_variable_value(scope_number, variable_name, new_value, call_frame_id)
Changes value of variable in a callframe. Object-based scopes are not supported and must be mutated manually.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
scope_number
|
int
|
0-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. |
required |
variable_name
|
str
|
Variable name. |
required |
new_value
|
CallArgument
|
New variable value. |
required |
call_frame_id
|
CallFrameId
|
Id of callframe that holds variable. |
required |
Source code in zendriver/cdp/debugger.py
step_into(break_on_async_call=None, skip_list=None)
Steps into the function call.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
break_on_async_call
|
Optional[bool]
|
(EXPERIMENTAL) (Optional) Debugger will pause on the execution of the first async task which was scheduled before next pause. |
None
|
skip_list
|
Optional[List[LocationRange]]
|
(EXPERIMENTAL) (Optional) The skipList specifies location ranges that should be skipped on step into. |
None
|
Source code in zendriver/cdp/debugger.py
step_out()
step_over(skip_list=None)
Steps over the statement.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
skip_list
|
Optional[List[LocationRange]]
|
(EXPERIMENTAL) (Optional) The skipList specifies location ranges that should be skipped on step over. |
None
|