runtime
BindingCalled
dataclass
EXPERIMENTAL
Notification is issued every time when binding is called.
Source code in zendriver/cdp/runtime.py
execution_context_id: ExecutionContextId
instance-attribute
name: str
instance-attribute
payload: str
instance-attribute
__init__(name, payload, execution_context_id)
from_json(json)
classmethod
Source code in zendriver/cdp/runtime.py
CallArgument
dataclass
Represents function call argument. Either remote object id objectId
, primitive value
,
unserializable primitive value or neither of (for undefined) them should be specified.
Source code in zendriver/cdp/runtime.py
object_id: typing.Optional[RemoteObjectId] = None
class-attribute
instance-attribute
unserializable_value: typing.Optional[UnserializableValue] = None
class-attribute
instance-attribute
value: typing.Optional[typing.Any] = None
class-attribute
instance-attribute
__init__(value=None, unserializable_value=None, object_id=None)
from_json(json)
classmethod
Source code in zendriver/cdp/runtime.py
to_json()
Source code in zendriver/cdp/runtime.py
CallFrame
dataclass
Stack entry for runtime errors and assertions.
Source code in zendriver/cdp/runtime.py
column_number: int
instance-attribute
function_name: str
instance-attribute
line_number: int
instance-attribute
script_id: ScriptId
instance-attribute
url: str
instance-attribute
__init__(function_name, script_id, url, line_number, column_number)
from_json(json)
classmethod
Source code in zendriver/cdp/runtime.py
to_json()
Source code in zendriver/cdp/runtime.py
ConsoleAPICalled
dataclass
Issued when console API was called.
Source code in zendriver/cdp/runtime.py
args: typing.List[RemoteObject]
instance-attribute
context: typing.Optional[str]
instance-attribute
execution_context_id: ExecutionContextId
instance-attribute
stack_trace: typing.Optional[StackTrace]
instance-attribute
timestamp: Timestamp
instance-attribute
type_: str
instance-attribute
__init__(type_, args, execution_context_id, timestamp, stack_trace, context)
from_json(json)
classmethod
Source code in zendriver/cdp/runtime.py
CustomPreview
dataclass
Source code in zendriver/cdp/runtime.py
body_getter_id: typing.Optional[RemoteObjectId] = None
class-attribute
instance-attribute
header: str
instance-attribute
__init__(header, body_getter_id=None)
from_json(json)
classmethod
Source code in zendriver/cdp/runtime.py
DeepSerializedValue
dataclass
Represents deep serialized value.
Source code in zendriver/cdp/runtime.py
object_id: typing.Optional[str] = None
class-attribute
instance-attribute
type_: str
instance-attribute
value: typing.Optional[typing.Any] = None
class-attribute
instance-attribute
weak_local_object_reference: typing.Optional[int] = None
class-attribute
instance-attribute
__init__(type_, value=None, object_id=None, weak_local_object_reference=None)
from_json(json)
classmethod
Source code in zendriver/cdp/runtime.py
to_json()
Source code in zendriver/cdp/runtime.py
EntryPreview
dataclass
Source code in zendriver/cdp/runtime.py
key: typing.Optional[ObjectPreview] = None
class-attribute
instance-attribute
value: ObjectPreview
instance-attribute
__init__(value, key=None)
from_json(json)
classmethod
ExceptionDetails
dataclass
Detailed information about exception (or error) that was thrown during script compilation or execution.
Source code in zendriver/cdp/runtime.py
662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 |
|
column_number: int
instance-attribute
exception: typing.Optional[RemoteObject] = None
class-attribute
instance-attribute
exception_id: int
instance-attribute
exception_meta_data: typing.Optional[dict] = None
class-attribute
instance-attribute
execution_context_id: typing.Optional[ExecutionContextId] = None
class-attribute
instance-attribute
line_number: int
instance-attribute
script_id: typing.Optional[ScriptId] = None
class-attribute
instance-attribute
stack_trace: typing.Optional[StackTrace] = None
class-attribute
instance-attribute
text: str
instance-attribute
url: typing.Optional[str] = None
class-attribute
instance-attribute
__init__(exception_id, text, line_number, column_number, script_id=None, url=None, stack_trace=None, exception=None, execution_context_id=None, exception_meta_data=None)
from_json(json)
classmethod
Source code in zendriver/cdp/runtime.py
to_json()
Source code in zendriver/cdp/runtime.py
ExceptionRevoked
dataclass
Issued when unhandled exception was revoked.
Source code in zendriver/cdp/runtime.py
exception_id: int
instance-attribute
reason: str
instance-attribute
__init__(reason, exception_id)
ExceptionThrown
dataclass
Issued when exception was thrown and unhandled.
Source code in zendriver/cdp/runtime.py
exception_details: ExceptionDetails
instance-attribute
timestamp: Timestamp
instance-attribute
__init__(timestamp, exception_details)
from_json(json)
classmethod
ExecutionContextCreated
dataclass
Issued when new execution context is created.
Source code in zendriver/cdp/runtime.py
context: ExecutionContextDescription
instance-attribute
__init__(context)
ExecutionContextDescription
dataclass
Description of an isolated world.
Source code in zendriver/cdp/runtime.py
aux_data: typing.Optional[dict] = None
class-attribute
instance-attribute
id_: ExecutionContextId
instance-attribute
name: str
instance-attribute
origin: str
instance-attribute
unique_id: str
instance-attribute
__init__(id_, origin, name, unique_id, aux_data=None)
from_json(json)
classmethod
Source code in zendriver/cdp/runtime.py
to_json()
Source code in zendriver/cdp/runtime.py
ExecutionContextDestroyed
dataclass
Issued when execution context is destroyed.
Source code in zendriver/cdp/runtime.py
execution_context_id: ExecutionContextId
instance-attribute
execution_context_unique_id: str
instance-attribute
__init__(execution_context_id, execution_context_unique_id)
from_json(json)
classmethod
Source code in zendriver/cdp/runtime.py
ExecutionContextId
Bases: int
Id of an execution context.
Source code in zendriver/cdp/runtime.py
__repr__()
from_json(json)
classmethod
ExecutionContextsCleared
dataclass
Issued when all executionContexts were cleared in browser
Source code in zendriver/cdp/runtime.py
InspectRequested
dataclass
Issued when object should be inspected (for example, as a result of inspect() command line API call).
Source code in zendriver/cdp/runtime.py
execution_context_id: typing.Optional[ExecutionContextId]
instance-attribute
hints: dict
instance-attribute
object_: RemoteObject
instance-attribute
__init__(object_, hints, execution_context_id)
from_json(json)
classmethod
Source code in zendriver/cdp/runtime.py
InternalPropertyDescriptor
dataclass
Object internal property descriptor. This property isn't normally visible in JavaScript code.
Source code in zendriver/cdp/runtime.py
name: str
instance-attribute
value: typing.Optional[RemoteObject] = None
class-attribute
instance-attribute
__init__(name, value=None)
from_json(json)
classmethod
ObjectPreview
dataclass
Object containing abbreviated remote object value.
Source code in zendriver/cdp/runtime.py
description: typing.Optional[str] = None
class-attribute
instance-attribute
entries: typing.Optional[typing.List[EntryPreview]] = None
class-attribute
instance-attribute
overflow: bool
instance-attribute
properties: typing.List[PropertyPreview]
instance-attribute
subtype: typing.Optional[str] = None
class-attribute
instance-attribute
type_: str
instance-attribute
__init__(type_, overflow, properties, subtype=None, description=None, entries=None)
from_json(json)
classmethod
Source code in zendriver/cdp/runtime.py
to_json()
Source code in zendriver/cdp/runtime.py
PrivatePropertyDescriptor
dataclass
Object private field descriptor.
Source code in zendriver/cdp/runtime.py
get: typing.Optional[RemoteObject] = None
class-attribute
instance-attribute
name: str
instance-attribute
set_: typing.Optional[RemoteObject] = None
class-attribute
instance-attribute
value: typing.Optional[RemoteObject] = None
class-attribute
instance-attribute
__init__(name, value=None, get=None, set_=None)
from_json(json)
classmethod
Source code in zendriver/cdp/runtime.py
to_json()
Source code in zendriver/cdp/runtime.py
PropertyDescriptor
dataclass
Object property descriptor.
Source code in zendriver/cdp/runtime.py
393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 |
|
configurable: bool
instance-attribute
enumerable: bool
instance-attribute
get: typing.Optional[RemoteObject] = None
class-attribute
instance-attribute
is_own: typing.Optional[bool] = None
class-attribute
instance-attribute
name: str
instance-attribute
set_: typing.Optional[RemoteObject] = None
class-attribute
instance-attribute
symbol: typing.Optional[RemoteObject] = None
class-attribute
instance-attribute
value: typing.Optional[RemoteObject] = None
class-attribute
instance-attribute
was_thrown: typing.Optional[bool] = None
class-attribute
instance-attribute
writable: typing.Optional[bool] = None
class-attribute
instance-attribute
__init__(name, configurable, enumerable, value=None, writable=None, get=None, set_=None, was_thrown=None, is_own=None, symbol=None)
from_json(json)
classmethod
Source code in zendriver/cdp/runtime.py
to_json()
Source code in zendriver/cdp/runtime.py
PropertyPreview
dataclass
Source code in zendriver/cdp/runtime.py
name: str
instance-attribute
subtype: typing.Optional[str] = None
class-attribute
instance-attribute
type_: str
instance-attribute
value: typing.Optional[str] = None
class-attribute
instance-attribute
value_preview: typing.Optional[ObjectPreview] = None
class-attribute
instance-attribute
__init__(name, type_, value=None, value_preview=None, subtype=None)
from_json(json)
classmethod
Source code in zendriver/cdp/runtime.py
to_json()
Source code in zendriver/cdp/runtime.py
RemoteObject
dataclass
Mirror object referencing original JavaScript object.
Source code in zendriver/cdp/runtime.py
144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 |
|
class_name: typing.Optional[str] = None
class-attribute
instance-attribute
custom_preview: typing.Optional[CustomPreview] = None
class-attribute
instance-attribute
deep_serialized_value: typing.Optional[DeepSerializedValue] = None
class-attribute
instance-attribute
description: typing.Optional[str] = None
class-attribute
instance-attribute
object_id: typing.Optional[RemoteObjectId] = None
class-attribute
instance-attribute
preview: typing.Optional[ObjectPreview] = None
class-attribute
instance-attribute
subtype: typing.Optional[str] = None
class-attribute
instance-attribute
type_: str
instance-attribute
unserializable_value: typing.Optional[UnserializableValue] = None
class-attribute
instance-attribute
value: typing.Optional[typing.Any] = None
class-attribute
instance-attribute
__init__(type_, subtype=None, class_name=None, value=None, unserializable_value=None, description=None, deep_serialized_value=None, object_id=None, preview=None, custom_preview=None)
from_json(json)
classmethod
Source code in zendriver/cdp/runtime.py
to_json()
Source code in zendriver/cdp/runtime.py
RemoteObjectId
Bases: str
Unique object identifier.
Source code in zendriver/cdp/runtime.py
__repr__()
from_json(json)
classmethod
ScriptId
Bases: str
Unique script identifier.
Source code in zendriver/cdp/runtime.py
__repr__()
from_json(json)
classmethod
SerializationOptions
dataclass
Represents options for serialization. Overrides generatePreview
and returnByValue
.
Source code in zendriver/cdp/runtime.py
additional_parameters: typing.Optional[dict] = None
class-attribute
instance-attribute
max_depth: typing.Optional[int] = None
class-attribute
instance-attribute
serialization: str
instance-attribute
__init__(serialization, max_depth=None, additional_parameters=None)
from_json(json)
classmethod
Source code in zendriver/cdp/runtime.py
to_json()
Source code in zendriver/cdp/runtime.py
StackTrace
dataclass
Call frames for assertions or error messages.
Source code in zendriver/cdp/runtime.py
call_frames: typing.List[CallFrame]
instance-attribute
description: typing.Optional[str] = None
class-attribute
instance-attribute
parent: typing.Optional[StackTrace] = None
class-attribute
instance-attribute
parent_id: typing.Optional[StackTraceId] = None
class-attribute
instance-attribute
__init__(call_frames, description=None, parent=None, parent_id=None)
from_json(json)
classmethod
Source code in zendriver/cdp/runtime.py
to_json()
Source code in zendriver/cdp/runtime.py
StackTraceId
dataclass
If debuggerId
is set stack trace comes from another debugger and can be resolved there. This
allows to track cross-debugger calls. See Runtime.StackTrace
and Debugger.paused
for usages.
Source code in zendriver/cdp/runtime.py
debugger_id: typing.Optional[UniqueDebuggerId] = None
class-attribute
instance-attribute
id_: str
instance-attribute
__init__(id_, debugger_id=None)
from_json(json)
classmethod
TimeDelta
Bases: float
Number of milliseconds.
Source code in zendriver/cdp/runtime.py
__repr__()
from_json(json)
classmethod
Timestamp
Bases: float
Number of milliseconds since epoch.
Source code in zendriver/cdp/runtime.py
__repr__()
from_json(json)
classmethod
UniqueDebuggerId
Bases: str
Unique identifier of current debugger.
Source code in zendriver/cdp/runtime.py
__repr__()
from_json(json)
classmethod
UnserializableValue
Bases: str
Primitive value which cannot be JSON-stringified. Includes values -0
, NaN
, Infinity
,
-Infinity
, and bigint literals.
Source code in zendriver/cdp/runtime.py
__repr__()
from_json(json)
classmethod
add_binding(name, execution_context_id=None, execution_context_name=None)
If executionContextId is empty, adds binding with the given name on the global objects of all inspected contexts, including those created later, bindings survive reloads. Binding function takes exactly one argument, this argument should be string, in case of any other input, function throws an exception. Each binding function call produces Runtime.bindingCalled notification.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
|
required |
execution_context_id
|
Optional[ExecutionContextId]
|
(DEPRECATED) (EXPERIMENTAL) (Optional) If specified, the binding would only be exposed to the specified execution context. If omitted and ```executionContextName |
None
|
execution_context_name
|
Optional[str]
|
(Optional) If specified, the binding is exposed to the executionContext with matching name, even for contexts created after the binding is added. See also |
None
|
Source code in zendriver/cdp/runtime.py
await_promise(promise_object_id, return_by_value=None, generate_preview=None)
Add handler to promise with given promise object id.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
promise_object_id
|
RemoteObjectId
|
Identifier of the promise. |
required |
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]
|
(Optional) Whether preview should be generated for the result. |
None
|
Returns:
Type | Description |
---|---|
Generator[T_JSON_DICT, T_JSON_DICT, Tuple[RemoteObject, Optional[ExceptionDetails]]]
|
A tuple with the following items: 0. result - Promise result. Will contain rejected value if promise was rejected. 1. exceptionDetails - (Optional) Exception details if stack strace is available. |
Source code in zendriver/cdp/runtime.py
call_function_on(function_declaration, object_id=None, arguments=None, silent=None, return_by_value=None, generate_preview=None, user_gesture=None, await_promise=None, execution_context_id=None, object_group=None, throw_on_side_effect=None, unique_context_id=None, serialization_options=None)
Calls function with given declaration on the given object. Object group of the result is inherited from the target object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
function_declaration
|
str
|
Declaration of the function to call. |
required |
object_id
|
Optional[RemoteObjectId]
|
(Optional) Identifier of the object to call function on. Either objectId or executionContextId should be specified. |
None
|
arguments
|
Optional[List[CallArgument]]
|
(Optional) Call arguments. All call arguments must belong to the same JavaScript world as the target object. |
None
|
silent
|
Optional[bool]
|
(Optional) In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides ```setPauseOnException```` state. |
None
|
return_by_value
|
Optional[bool]
|
(Optional) Whether the result is expected to be a JSON object which should be sent by value. Can be overriden by |
None
|
generate_preview
|
Optional[bool]
|
(EXPERIMENTAL) (Optional) Whether preview should be generated for the result. |
None
|
user_gesture
|
Optional[bool]
|
(Optional) Whether execution should be treated as initiated by user in the UI. |
None
|
await_promise
|
Optional[bool]
|
(Optional) Whether execution should |
None
|
execution_context_id
|
Optional[ExecutionContextId]
|
(Optional) Specifies execution context which global object will be used to call function on. Either executionContextId or objectId should be specified. |
None
|
object_group
|
Optional[str]
|
(Optional) Symbolic group name that can be used to release multiple objects. If objectGroup is not specified and objectId is, objectGroup will be inherited from object. |
None
|
throw_on_side_effect
|
Optional[bool]
|
(EXPERIMENTAL) (Optional) Whether to throw an exception if side effect cannot be ruled out during evaluation. |
None
|
unique_context_id
|
Optional[str]
|
(EXPERIMENTAL) (Optional) An alternative way to specify the execution context to call function on. Compared to contextId that may be reused across processes, this is guaranteed to be system-unique, so it can be used to prevent accidental function call in context different than intended (e.g. as a result of navigation across process boundaries). This is mutually exclusive with |
None
|
serialization_options
|
Optional[SerializationOptions]
|
(EXPERIMENTAL) (Optional) Specifies the result serialization. If provided, overrides |
None
|
Returns:
Type | Description |
---|---|
Generator[T_JSON_DICT, T_JSON_DICT, Tuple[RemoteObject, Optional[ExceptionDetails]]]
|
A tuple with the following items: 0. result - Call result. 1. exceptionDetails - (Optional) Exception details. |
Source code in zendriver/cdp/runtime.py
951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 |
|
compile_script(expression, source_url, persist_script, execution_context_id=None)
Compiles expression.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
expression
|
str
|
Expression to compile. |
required |
source_url
|
str
|
Source url to be set for the script. |
required |
persist_script
|
bool
|
Specifies whether the compiled script should be persisted. |
required |
execution_context_id
|
Optional[ExecutionContextId]
|
(Optional) Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page. |
None
|
Returns:
Type | Description |
---|---|
Generator[T_JSON_DICT, T_JSON_DICT, Tuple[Optional[ScriptId], Optional[ExceptionDetails]]]
|
A tuple with the following items: 0. scriptId - (Optional) Id of the script. 1. exceptionDetails - (Optional) Exception details. |
Source code in zendriver/cdp/runtime.py
disable()
Disables reporting of execution contexts creation.
discard_console_entries()
Discards collected exceptions and console API calls.
Source code in zendriver/cdp/runtime.py
enable()
Enables reporting of execution contexts creation by means of executionContextCreated
event.
When the reporting gets enabled the event will be sent immediately for each existing execution
context.
Source code in zendriver/cdp/runtime.py
evaluate(expression, object_group=None, include_command_line_api=None, silent=None, context_id=None, return_by_value=None, generate_preview=None, user_gesture=None, await_promise=None, throw_on_side_effect=None, timeout=None, disable_breaks=None, repl_mode=None, allow_unsafe_eval_blocked_by_csp=None, unique_context_id=None, serialization_options=None)
Evaluates expression on global object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
expression
|
str
|
Expression to evaluate. |
required |
object_group
|
Optional[str]
|
(Optional) Symbolic group name that can be used to release multiple objects. |
None
|
include_command_line_api
|
Optional[bool]
|
(Optional) Determines whether Command Line API should be available during the evaluation. |
None
|
silent
|
Optional[bool]
|
(Optional) In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides ```setPauseOnException```` state. |
None
|
context_id
|
Optional[ExecutionContextId]
|
(Optional) Specifies in which execution context to perform evaluation. If the parameter is omitted the evaluation will be performed in the context of the inspected page. This is mutually exclusive with |
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
|
user_gesture
|
Optional[bool]
|
(Optional) Whether execution should be treated as initiated by user in the UI. |
None
|
await_promise
|
Optional[bool]
|
(Optional) Whether execution should |
None
|
throw_on_side_effect
|
Optional[bool]
|
(EXPERIMENTAL) (Optional) Whether to throw an exception if side effect cannot be ruled out during evaluation. This implies |
None
|
timeout
|
Optional[TimeDelta]
|
(EXPERIMENTAL) (Optional) Terminate execution after timing out (number of milliseconds). |
None
|
disable_breaks
|
Optional[bool]
|
(EXPERIMENTAL) (Optional) Disable breakpoints during execution. |
None
|
repl_mode
|
Optional[bool]
|
(EXPERIMENTAL) (Optional) Setting this flag to true enables |
None
|
allow_unsafe_eval_blocked_by_csp
|
Optional[bool]
|
(EXPERIMENTAL) (Optional) The Content Security Policy (CSP) for the target might block 'unsafe-eval' which includes eval(), Function(), setTimeout() and setInterval() when called with non-callable arguments. This flag bypasses CSP for this evaluation and allows unsafe-eval. Defaults to true. |
None
|
unique_context_id
|
Optional[str]
|
(EXPERIMENTAL) (Optional) An alternative way to specify the execution context to evaluate in. Compared to contextId that may be reused across processes, this is guaranteed to be system-unique, so it can be used to prevent accidental evaluation of the expression in context different than intended (e.g. as a result of navigation across process boundaries). This is mutually exclusive with |
None
|
serialization_options
|
Optional[SerializationOptions]
|
(EXPERIMENTAL) (Optional) Specifies the result serialization. If provided, overrides |
None
|
Returns:
Type | Description |
---|---|
Generator[T_JSON_DICT, T_JSON_DICT, Tuple[RemoteObject, Optional[ExceptionDetails]]]
|
A tuple with the following items: 0. result - Evaluation result. 1. exceptionDetails - (Optional) Exception details. |
Source code in zendriver/cdp/runtime.py
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 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 |
|
get_exception_details(error_object_id)
This method tries to lookup and populate exception details for a JavaScript Error object. Note that the stackTrace portion of the resulting exceptionDetails will only be populated if the Runtime domain was enabled at the time when the Error was thrown.
EXPERIMENTAL
Parameters:
Name | Type | Description | Default |
---|---|---|---|
error_object_id
|
RemoteObjectId
|
The error object for which to resolve the exception details. |
required |
Returns:
Type | Description |
---|---|
Generator[T_JSON_DICT, T_JSON_DICT, Optional[ExceptionDetails]]
|
|
Source code in zendriver/cdp/runtime.py
get_heap_usage()
Returns the JavaScript heap usage. It is the total usage of the corresponding isolate not scoped to a particular Runtime.
EXPERIMENTAL
Returns:
Type | Description |
---|---|
Generator[T_JSON_DICT, T_JSON_DICT, Tuple[float, float]]
|
A tuple with the following items: 0. usedSize - Used heap size in bytes. 1. totalSize - Allocated heap size in bytes. |
Source code in zendriver/cdp/runtime.py
get_isolate_id()
Returns the isolate id.
EXPERIMENTAL
Returns:
Type | Description |
---|---|
Generator[T_JSON_DICT, T_JSON_DICT, str]
|
The isolate id. |
Source code in zendriver/cdp/runtime.py
get_properties(object_id, own_properties=None, accessor_properties_only=None, generate_preview=None, non_indexed_properties_only=None)
Returns properties of a given object. Object group of the result is inherited from the target object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
object_id
|
RemoteObjectId
|
Identifier of the object to return properties for. |
required |
own_properties
|
Optional[bool]
|
(Optional) If true, returns properties belonging only to the element itself, not to its prototype chain. |
None
|
accessor_properties_only
|
Optional[bool]
|
(EXPERIMENTAL) (Optional) If true, returns accessor properties (with getter/setter) only; internal properties are not returned either. |
None
|
generate_preview
|
Optional[bool]
|
(EXPERIMENTAL) (Optional) Whether preview should be generated for the results. |
None
|
non_indexed_properties_only
|
Optional[bool]
|
(EXPERIMENTAL) (Optional) If true, returns non-indexed properties only. |
None
|
Returns:
Type | Description |
---|---|
Generator[T_JSON_DICT, T_JSON_DICT, Tuple[List[PropertyDescriptor], Optional[List[InternalPropertyDescriptor]], Optional[List[PrivatePropertyDescriptor]], Optional[ExceptionDetails]]]
|
A tuple with the following items: 0. result - Object properties. 1. internalProperties - (Optional) Internal object properties (only of the element itself). 2. privateProperties - (Optional) Object private properties. 3. exceptionDetails - (Optional) Exception details. |
Source code in zendriver/cdp/runtime.py
global_lexical_scope_names(execution_context_id=None)
Returns all let, const and class variables from global scope.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
execution_context_id
|
Optional[ExecutionContextId]
|
(Optional) Specifies in which execution context to lookup global scope variables. |
None
|
Returns:
Type | Description |
---|---|
Generator[T_JSON_DICT, T_JSON_DICT, List[str]]
|
|
Source code in zendriver/cdp/runtime.py
query_objects(prototype_object_id, object_group=None)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
prototype_object_id
|
RemoteObjectId
|
Identifier of the prototype to return objects for. |
required |
object_group
|
Optional[str]
|
(Optional) Symbolic group name that can be used to release the results. |
None
|
Returns:
Type | Description |
---|---|
Generator[T_JSON_DICT, T_JSON_DICT, RemoteObject]
|
Array with objects. |
Source code in zendriver/cdp/runtime.py
release_object(object_id)
Releases remote object with given id.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
object_id
|
RemoteObjectId
|
Identifier of the object to release. |
required |
Source code in zendriver/cdp/runtime.py
release_object_group(object_group)
Releases all remote objects that belong to a given group.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
object_group
|
str
|
Symbolic object group name. |
required |
Source code in zendriver/cdp/runtime.py
remove_binding(name)
This method does not remove binding function from global object but unsubscribes current runtime agent from Runtime.bindingCalled notifications.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
|
required |
Source code in zendriver/cdp/runtime.py
run_if_waiting_for_debugger()
Tells inspected instance to run if it was waiting for debugger to attach.
Source code in zendriver/cdp/runtime.py
run_script(script_id, execution_context_id=None, object_group=None, silent=None, include_command_line_api=None, return_by_value=None, generate_preview=None, await_promise=None)
Runs script with given id in a given context.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
script_id
|
ScriptId
|
Id of the script to run. |
required |
execution_context_id
|
Optional[ExecutionContextId]
|
(Optional) Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page. |
None
|
object_group
|
Optional[str]
|
(Optional) Symbolic group name that can be used to release multiple objects. |
None
|
silent
|
Optional[bool]
|
(Optional) In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides ```setPauseOnException```` state. |
None
|
include_command_line_api
|
Optional[bool]
|
(Optional) Determines whether Command Line API should be available during the evaluation. |
None
|
return_by_value
|
Optional[bool]
|
(Optional) Whether the result is expected to be a JSON object which should be sent by value. |
None
|
generate_preview
|
Optional[bool]
|
(Optional) Whether preview should be generated for the result. |
None
|
await_promise
|
Optional[bool]
|
(Optional) Whether execution should |
None
|
Returns:
Type | Description |
---|---|
Generator[T_JSON_DICT, T_JSON_DICT, Tuple[RemoteObject, Optional[ExceptionDetails]]]
|
A tuple with the following items: 0. result - Run result. 1. exceptionDetails - (Optional) Exception details. |
Source code in zendriver/cdp/runtime.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/runtime.py
set_custom_object_formatter_enabled(enabled)
EXPERIMENTAL
Parameters:
Name | Type | Description | Default |
---|---|---|---|
enabled
|
bool
|
|
required |
Source code in zendriver/cdp/runtime.py
set_max_call_stack_size_to_capture(size)
EXPERIMENTAL
Parameters:
Name | Type | Description | Default |
---|---|---|---|
size
|
int
|
|
required |
Source code in zendriver/cdp/runtime.py
terminate_execution()
Terminate current or next JavaScript execution. Will cancel the termination when the outer-most script execution ends.
EXPERIMENTAL