cdp_driver/methods/runtime.rs
1// @generated by `just generate-methods` from protocol/*.json.
2// Do not edit by hand; edit xtask/ and regenerate.
3
4//! Runtime domain exposes JavaScript runtime by means of remote evaluation
5//! and mirror objects. Evaluation results are returned as mirror object that
6//! expose object type, string representation and unique identifier that can
7//! be used for further object reference. Original objects are maintained in
8//! memory unless they are either explicitly released or are released along
9//! with the other objects in their object group.
10//!
11//! Method names for the `Runtime` domain, for use with
12//! [`CdpClient::call`](crate::CdpClient::call).
13
14/// Add handler to promise with given promise object id.
15///
16/// Parameters:
17/// - `promiseObjectId`: RemoteObjectId
18/// - `returnByValue`: boolean (optional)
19/// - `generatePreview`: boolean (optional)
20///
21/// Returns: `result`, `exceptionDetails`
22pub const AWAIT_PROMISE: &str = "Runtime.awaitPromise";
23
24/// Calls function with given declaration on the given object. Object group of
25/// the result is inherited from the target object.
26///
27/// Parameters:
28/// - `functionDeclaration`: string
29/// - `objectId`: RemoteObjectId (optional)
30/// - `arguments`: array (optional)
31/// - `silent`: boolean (optional)
32/// - `returnByValue`: boolean (optional)
33/// - `generatePreview`: boolean (optional)
34/// - `userGesture`: boolean (optional)
35/// - `awaitPromise`: boolean (optional)
36/// - `executionContextId`: ExecutionContextId (optional)
37/// - `objectGroup`: string (optional)
38/// - `throwOnSideEffect`: boolean (optional)
39/// - `uniqueContextId`: string (optional)
40/// - `serializationOptions`: SerializationOptions (optional)
41///
42/// Returns: `result`, `exceptionDetails`
43pub const CALL_FUNCTION_ON: &str = "Runtime.callFunctionOn";
44
45/// Compiles expression.
46///
47/// Parameters:
48/// - `expression`: string
49/// - `sourceURL`: string
50/// - `persistScript`: boolean
51/// - `executionContextId`: ExecutionContextId (optional)
52///
53/// Returns: `scriptId`, `exceptionDetails`
54pub const COMPILE_SCRIPT: &str = "Runtime.compileScript";
55
56/// Disables reporting of execution contexts creation.
57pub const DISABLE: &str = "Runtime.disable";
58
59/// Discards collected exceptions and console API calls.
60pub const DISCARD_CONSOLE_ENTRIES: &str = "Runtime.discardConsoleEntries";
61
62/// Enables reporting of execution contexts creation by means of
63/// `executionContextCreated` event. When the reporting gets enabled the event
64/// will be sent immediately for each existing execution context.
65pub const ENABLE: &str = "Runtime.enable";
66
67/// Evaluates expression on global object.
68///
69/// Parameters:
70/// - `expression`: string
71/// - `objectGroup`: string (optional)
72/// - `includeCommandLineAPI`: boolean (optional)
73/// - `silent`: boolean (optional)
74/// - `contextId`: ExecutionContextId (optional)
75/// - `returnByValue`: boolean (optional)
76/// - `generatePreview`: boolean (optional)
77/// - `userGesture`: boolean (optional)
78/// - `awaitPromise`: boolean (optional)
79/// - `throwOnSideEffect`: boolean (optional)
80/// - `timeout`: TimeDelta (optional)
81/// - `disableBreaks`: boolean (optional)
82/// - `replMode`: boolean (optional)
83/// - `allowUnsafeEvalBlockedByCSP`: boolean (optional)
84/// - `uniqueContextId`: string (optional)
85/// - `serializationOptions`: SerializationOptions (optional)
86///
87/// Returns: `result`, `exceptionDetails`
88pub const EVALUATE: &str = "Runtime.evaluate";
89
90/// Returns the isolate id.
91///
92/// Experimental: may change without notice.
93///
94/// Returns: `id`
95pub const GET_ISOLATE_ID: &str = "Runtime.getIsolateId";
96
97/// Returns the JavaScript heap usage. It is the total usage of the
98/// corresponding isolate not scoped to a particular Runtime.
99///
100/// Experimental: may change without notice.
101///
102/// Returns: `usedSize`, `totalSize`, `embedderHeapUsedSize`, `backingStorageSize`
103pub const GET_HEAP_USAGE: &str = "Runtime.getHeapUsage";
104
105/// Returns properties of a given object. Object group of the result is
106/// inherited from the target object.
107///
108/// Parameters:
109/// - `objectId`: RemoteObjectId
110/// - `ownProperties`: boolean (optional)
111/// - `accessorPropertiesOnly`: boolean (optional)
112/// - `generatePreview`: boolean (optional)
113/// - `nonIndexedPropertiesOnly`: boolean (optional)
114///
115/// Returns: `result`, `internalProperties`, `privateProperties`, `exceptionDetails`
116pub const GET_PROPERTIES: &str = "Runtime.getProperties";
117
118/// Returns all let, const and class variables from global scope.
119///
120/// Parameters:
121/// - `executionContextId`: ExecutionContextId (optional)
122///
123/// Returns: `names`
124pub const GLOBAL_LEXICAL_SCOPE_NAMES: &str = "Runtime.globalLexicalScopeNames";
125
126/// `Runtime.queryObjects`
127///
128/// Parameters:
129/// - `prototypeObjectId`: RemoteObjectId
130/// - `objectGroup`: string (optional)
131///
132/// Returns: `objects`
133pub const QUERY_OBJECTS: &str = "Runtime.queryObjects";
134
135/// Releases remote object with given id.
136///
137/// Parameters:
138/// - `objectId`: RemoteObjectId
139pub const RELEASE_OBJECT: &str = "Runtime.releaseObject";
140
141/// Releases all remote objects that belong to a given group.
142///
143/// Parameters:
144/// - `objectGroup`: string
145pub const RELEASE_OBJECT_GROUP: &str = "Runtime.releaseObjectGroup";
146
147/// Tells inspected instance to run if it was waiting for debugger to attach.
148pub const RUN_IF_WAITING_FOR_DEBUGGER: &str = "Runtime.runIfWaitingForDebugger";
149
150/// Runs script with given id in a given context.
151///
152/// Parameters:
153/// - `scriptId`: ScriptId
154/// - `executionContextId`: ExecutionContextId (optional)
155/// - `objectGroup`: string (optional)
156/// - `silent`: boolean (optional)
157/// - `includeCommandLineAPI`: boolean (optional)
158/// - `returnByValue`: boolean (optional)
159/// - `generatePreview`: boolean (optional)
160/// - `awaitPromise`: boolean (optional)
161///
162/// Returns: `result`, `exceptionDetails`
163pub const RUN_SCRIPT: &str = "Runtime.runScript";
164
165/// Enables or disables async call stacks tracking.
166///
167/// Parameters:
168/// - `maxDepth`: integer
169pub const SET_ASYNC_CALL_STACK_DEPTH: &str = "Runtime.setAsyncCallStackDepth";
170
171/// `Runtime.setCustomObjectFormatterEnabled`
172///
173/// Experimental: may change without notice.
174///
175/// Parameters:
176/// - `enabled`: boolean
177pub const SET_CUSTOM_OBJECT_FORMATTER_ENABLED: &str = "Runtime.setCustomObjectFormatterEnabled";
178
179/// `Runtime.setMaxCallStackSizeToCapture`
180///
181/// Experimental: may change without notice.
182///
183/// Parameters:
184/// - `size`: integer
185pub const SET_MAX_CALL_STACK_SIZE_TO_CAPTURE: &str = "Runtime.setMaxCallStackSizeToCapture";
186
187/// Terminate current or next JavaScript execution. Will cancel the
188/// termination when the outer-most script execution ends.
189///
190/// Experimental: may change without notice.
191pub const TERMINATE_EXECUTION: &str = "Runtime.terminateExecution";
192
193/// If executionContextId is empty, adds binding with the given name on the
194/// global objects of all inspected contexts, including those created later,
195/// bindings survive reloads. Binding function takes exactly one argument,
196/// this argument should be string, in case of any other input, function
197/// throws an exception. Each binding function call produces
198/// Runtime.bindingCalled notification.
199///
200/// Parameters:
201/// - `name`: string
202/// - `executionContextId`: ExecutionContextId (optional)
203/// - `executionContextName`: string (optional)
204pub const ADD_BINDING: &str = "Runtime.addBinding";
205
206/// This method does not remove binding function from global object but
207/// unsubscribes current runtime agent from Runtime.bindingCalled
208/// notifications.
209///
210/// Parameters:
211/// - `name`: string
212pub const REMOVE_BINDING: &str = "Runtime.removeBinding";
213
214/// This method tries to lookup and populate exception details for a
215/// JavaScript Error object. Note that the stackTrace portion of the resulting
216/// exceptionDetails will only be populated if the Runtime domain was enabled
217/// at the time when the Error was thrown.
218///
219/// Experimental: may change without notice.
220///
221/// Parameters:
222/// - `errorObjectId`: RemoteObjectId
223///
224/// Returns: `exceptionDetails`
225pub const GET_EXCEPTION_DETAILS: &str = "Runtime.getExceptionDetails";