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
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 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 |
|
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
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 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 |
|
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
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 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 |
|
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
1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 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 |
|
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
1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 |
|
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
1308 1309 1310 1311 1312 1313 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 |
|
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