1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
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
// @generated by `just generate-methods` from protocol/*.json.
// Do not edit by hand; edit xtask/ and regenerate.
//! Runtime domain exposes JavaScript runtime by means of remote evaluation
//! and mirror objects. Evaluation results are returned as mirror object that
//! expose object type, string representation and unique identifier that can
//! be used for further object reference. Original objects are maintained in
//! memory unless they are either explicitly released or are released along
//! with the other objects in their object group.
//!
//! Method names for the `Runtime` domain, for use with
//! [`CdpClient::call`](crate::CdpClient::call).
/// Add handler to promise with given promise object id.
///
/// Parameters:
/// - `promiseObjectId`: RemoteObjectId
/// - `returnByValue`: boolean (optional)
/// - `generatePreview`: boolean (optional)
///
/// Returns: `result`, `exceptionDetails`
pub const AWAIT_PROMISE: &str = "Runtime.awaitPromise";
/// Calls function with given declaration on the given object. Object group of
/// the result is inherited from the target object.
///
/// Parameters:
/// - `functionDeclaration`: string
/// - `objectId`: RemoteObjectId (optional)
/// - `arguments`: array (optional)
/// - `silent`: boolean (optional)
/// - `returnByValue`: boolean (optional)
/// - `generatePreview`: boolean (optional)
/// - `userGesture`: boolean (optional)
/// - `awaitPromise`: boolean (optional)
/// - `executionContextId`: ExecutionContextId (optional)
/// - `objectGroup`: string (optional)
/// - `throwOnSideEffect`: boolean (optional)
/// - `uniqueContextId`: string (optional)
/// - `serializationOptions`: SerializationOptions (optional)
///
/// Returns: `result`, `exceptionDetails`
pub const CALL_FUNCTION_ON: &str = "Runtime.callFunctionOn";
/// Compiles expression.
///
/// Parameters:
/// - `expression`: string
/// - `sourceURL`: string
/// - `persistScript`: boolean
/// - `executionContextId`: ExecutionContextId (optional)
///
/// Returns: `scriptId`, `exceptionDetails`
pub const COMPILE_SCRIPT: &str = "Runtime.compileScript";
/// Disables reporting of execution contexts creation.
pub const DISABLE: &str = "Runtime.disable";
/// Discards collected exceptions and console API calls.
pub const DISCARD_CONSOLE_ENTRIES: &str = "Runtime.discardConsoleEntries";
/// 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.
pub const ENABLE: &str = "Runtime.enable";
/// Evaluates expression on global object.
///
/// Parameters:
/// - `expression`: string
/// - `objectGroup`: string (optional)
/// - `includeCommandLineAPI`: boolean (optional)
/// - `silent`: boolean (optional)
/// - `contextId`: ExecutionContextId (optional)
/// - `returnByValue`: boolean (optional)
/// - `generatePreview`: boolean (optional)
/// - `userGesture`: boolean (optional)
/// - `awaitPromise`: boolean (optional)
/// - `throwOnSideEffect`: boolean (optional)
/// - `timeout`: TimeDelta (optional)
/// - `disableBreaks`: boolean (optional)
/// - `replMode`: boolean (optional)
/// - `allowUnsafeEvalBlockedByCSP`: boolean (optional)
/// - `uniqueContextId`: string (optional)
/// - `serializationOptions`: SerializationOptions (optional)
///
/// Returns: `result`, `exceptionDetails`
pub const EVALUATE: &str = "Runtime.evaluate";
/// Returns the isolate id.
///
/// Experimental: may change without notice.
///
/// Returns: `id`
pub const GET_ISOLATE_ID: &str = "Runtime.getIsolateId";
/// Returns the JavaScript heap usage. It is the total usage of the
/// corresponding isolate not scoped to a particular Runtime.
///
/// Experimental: may change without notice.
///
/// Returns: `usedSize`, `totalSize`, `embedderHeapUsedSize`, `backingStorageSize`
pub const GET_HEAP_USAGE: &str = "Runtime.getHeapUsage";
/// Returns properties of a given object. Object group of the result is
/// inherited from the target object.
///
/// Parameters:
/// - `objectId`: RemoteObjectId
/// - `ownProperties`: boolean (optional)
/// - `accessorPropertiesOnly`: boolean (optional)
/// - `generatePreview`: boolean (optional)
/// - `nonIndexedPropertiesOnly`: boolean (optional)
///
/// Returns: `result`, `internalProperties`, `privateProperties`, `exceptionDetails`
pub const GET_PROPERTIES: &str = "Runtime.getProperties";
/// Returns all let, const and class variables from global scope.
///
/// Parameters:
/// - `executionContextId`: ExecutionContextId (optional)
///
/// Returns: `names`
pub const GLOBAL_LEXICAL_SCOPE_NAMES: &str = "Runtime.globalLexicalScopeNames";
/// `Runtime.queryObjects`
///
/// Parameters:
/// - `prototypeObjectId`: RemoteObjectId
/// - `objectGroup`: string (optional)
///
/// Returns: `objects`
pub const QUERY_OBJECTS: &str = "Runtime.queryObjects";
/// Releases remote object with given id.
///
/// Parameters:
/// - `objectId`: RemoteObjectId
pub const RELEASE_OBJECT: &str = "Runtime.releaseObject";
/// Releases all remote objects that belong to a given group.
///
/// Parameters:
/// - `objectGroup`: string
pub const RELEASE_OBJECT_GROUP: &str = "Runtime.releaseObjectGroup";
/// Tells inspected instance to run if it was waiting for debugger to attach.
pub const RUN_IF_WAITING_FOR_DEBUGGER: &str = "Runtime.runIfWaitingForDebugger";
/// Runs script with given id in a given context.
///
/// Parameters:
/// - `scriptId`: ScriptId
/// - `executionContextId`: ExecutionContextId (optional)
/// - `objectGroup`: string (optional)
/// - `silent`: boolean (optional)
/// - `includeCommandLineAPI`: boolean (optional)
/// - `returnByValue`: boolean (optional)
/// - `generatePreview`: boolean (optional)
/// - `awaitPromise`: boolean (optional)
///
/// Returns: `result`, `exceptionDetails`
pub const RUN_SCRIPT: &str = "Runtime.runScript";
/// Enables or disables async call stacks tracking.
///
/// Parameters:
/// - `maxDepth`: integer
pub const SET_ASYNC_CALL_STACK_DEPTH: &str = "Runtime.setAsyncCallStackDepth";
/// `Runtime.setCustomObjectFormatterEnabled`
///
/// Experimental: may change without notice.
///
/// Parameters:
/// - `enabled`: boolean
pub const SET_CUSTOM_OBJECT_FORMATTER_ENABLED: &str = "Runtime.setCustomObjectFormatterEnabled";
/// `Runtime.setMaxCallStackSizeToCapture`
///
/// Experimental: may change without notice.
///
/// Parameters:
/// - `size`: integer
pub const SET_MAX_CALL_STACK_SIZE_TO_CAPTURE: &str = "Runtime.setMaxCallStackSizeToCapture";
/// Terminate current or next JavaScript execution. Will cancel the
/// termination when the outer-most script execution ends.
///
/// Experimental: may change without notice.
pub const TERMINATE_EXECUTION: &str = "Runtime.terminateExecution";
/// 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`: string
/// - `executionContextId`: ExecutionContextId (optional)
/// - `executionContextName`: string (optional)
pub const ADD_BINDING: &str = "Runtime.addBinding";
/// This method does not remove binding function from global object but
/// unsubscribes current runtime agent from Runtime.bindingCalled
/// notifications.
///
/// Parameters:
/// - `name`: string
pub const REMOVE_BINDING: &str = "Runtime.removeBinding";
/// 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: may change without notice.
///
/// Parameters:
/// - `errorObjectId`: RemoteObjectId
///
/// Returns: `exceptionDetails`
pub const GET_EXCEPTION_DETAILS: &str = "Runtime.getExceptionDetails";