Runtime Domain
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.
Methods
- Runtime.awaitPromise
- Runtime.callFunctionOn
- Runtime.compileScript
- Runtime.disable
- Runtime.discardConsoleEntries
- Runtime.enable
- Runtime.evaluate
- Runtime.getProperties
- Runtime.releaseObject
- Runtime.releaseObjectGroup
- Runtime.runIfWaitingForDebugger
- Runtime.runScript
Events
- Runtime.consoleAPICalled
- Runtime.exceptionRevoked
- Runtime.exceptionThrown
- Runtime.executionContextCreated
- Runtime.executionContextDestroyed
- Runtime.executionContextsCleared
- Runtime.inspectRequested
Types
- Runtime.CallArgument
- Runtime.CallFrame
- Runtime.ExceptionDetails
- Runtime.ExecutionContextDescription
- Runtime.ExecutionContextId
- Runtime.InternalPropertyDescriptor
- Runtime.PropertyDescriptor
- Runtime.RemoteObject
- Runtime.RemoteObjectId
- Runtime.ScriptId
- Runtime.StackTrace
- Runtime.Timestamp
- Runtime.UnserializableValue
Methods
Runtime.awaitPromise #
Add handler to promise with given promise object id.
Parameters
promiseObjectId Identifier of the promise.
returnByValueOptional
booleanWhether the result is expected to be a JSON object that should be sent by value.
generatePreviewOptional
booleanWhether preview should be generated for the result.
Return object
result Promise result. Will contain rejected value if promise was rejected.
exceptionDetailsOptional
Exception details if stack strace is available.
Runtime.callFunctionOn #
Calls function with given declaration on the given object. Object group of the result is inherited from the target object.
In V8, @cdp Runtime.evaluate and @cdp Runtime.callFunctionOn populate the
result field with the exception value, and some code paths in Chrome
DevTools depend on this.
See
https://github.com/facebookexperimental/rn-chrome-devtools-frontend/blob/35aa264a622e853bb28b4c83a7b5cc3b2a9747bc/front_end/core/sdk/RemoteObject.ts#L574-L592
Handles Runtime.callFunctionOn request @cdp Runtime.callFunctionOn Allowed even if domain is not enabled.
Parameters
objectId Identifier of the object to call function on.
functionDeclaration stringDeclaration of the function to call.
argumentsOptional
array[ CallArgument ]Call arguments. All call arguments must belong to the same JavaScript world as the target object.
silentOptional
booleanIn silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state.
returnByValueOptional
booleanWhether the result is expected to be a JSON object which should be sent by value.
generatePreviewOptional
booleanWhether preview should be generated for the result.
userGestureOptional
booleanWhether execution should be treated as initiated by user in the UI.
awaitPromiseOptional
booleanWhether execution should wait for promise to be resolved. If the result of evaluation is not a Promise, it's considered to be an error.
Return object
result Call result.
exceptionDetailsOptional
Exception details.
Runtime.compileScript #
Compiles expression.
Handles Runtime.compileScript request @cdp Runtime.compileScript Not allowed if domain is not enabled.
Parameters
expression stringExpression to compile.
sourceURL stringSource url to be set for the script.
persistScript booleanSpecifies whether the compiled script should be persisted.
executionContextIdOptional
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.
Return object
scriptIdOptional
Id of the script.
exceptionDetailsOptional
Exception details.
Runtime.disable #
Disables reporting of execution contexts creation.
Handles Runtime.disable request @cdp Runtime.disable If domain is already disabled, will return success.
Runtime.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.
Handles Runtime.enable request @cdp Runtime.enable If domain is already enabled, will return success.
Runtime.evaluate #
Evaluates expression on global object.
In V8, @cdp Runtime.evaluate and @cdp Runtime.callFunctionOn populate the
result field with the exception value, and some code paths in Chrome
DevTools depend on this.
See
https://github.com/facebookexperimental/rn-chrome-devtools-frontend/blob/35aa264a622e853bb28b4c83a7b5cc3b2a9747bc/front_end/core/sdk/RemoteObject.ts#L574-L592
Handles Runtime.evaluate request @cdp Runtime.evaluate Allowed even if domain is not enabled.
Parameters
expression stringExpression to evaluate.
objectGroupOptional
stringSymbolic group name that can be used to release multiple objects.
includeCommandLineAPIOptional
booleanDetermines whether Command Line API should be available during the evaluation.
silentOptional
booleanIn silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state.
contextIdOptional
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.
returnByValueOptional
booleanWhether the result is expected to be a JSON object that should be sent by value.
generatePreviewOptional
booleanWhether preview should be generated for the result.
userGestureOptional
booleanWhether execution should be treated as initiated by user in the UI.
awaitPromiseOptional
booleanWhether execution should wait for promise to be resolved. If the result of evaluation is not a Promise, it's considered to be an error.
Return object
result Evaluation result.
exceptionDetailsOptional
Exception details.
Runtime.getProperties #
Returns properties of a given object. Object group of the result is inherited from the target object.
Handles Runtime.getProperties request @cdp Runtime.getProperties Allowed even if domain is not enabled.
Parameters
objectId Identifier of the object to return properties for.
ownPropertiesOptional
booleanIf true, returns properties belonging only to the element itself, not to its prototype chain.
accessorPropertiesOnlyOptional
booleanIf true, returns accessor properties (with getter/setter) only; internal properties are not returned either.
generatePreviewOptional
booleanWhether preview should be generated for the results.
Return object
result array[ PropertyDescriptor ]Object properties.
internalPropertiesOptional
array[ InternalPropertyDescriptor ]Internal object properties (only of the element itself).
exceptionDetailsOptional
Exception details.
Runtime.releaseObject #
Releases remote object with given id.
Handles Runtime.releaseObject request @cdp Runtime.releaseObject Allowed even if domain is not enabled.
Parameters
objectId Identifier of the object to release.
Runtime.releaseObjectGroup #
Releases all remote objects that belong to a given group.
Handles Runtime.releaseObjectGroup request @cdp Runtime.releaseObjectGroup Allowed even if domain is not enabled.
Parameters
objectGroup stringSymbolic object group name.
Runtime.runIfWaitingForDebugger #
Tells inspected instance to run if it was waiting for debugger to attach.
Runtime.runScript #
Runs script with given id in a given context.
Parameters
scriptId Id of the script to run.
executionContextIdOptional
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.
objectGroupOptional
stringSymbolic group name that can be used to release multiple objects.
silentOptional
booleanIn silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state.
includeCommandLineAPIOptional
booleanDetermines whether Command Line API should be available during the evaluation.
returnByValueOptional
booleanWhether the result is expected to be a JSON object which should be sent by value.
generatePreviewOptional
booleanWhether preview should be generated for the result.
awaitPromiseOptional
booleanWhether execution should wait for promise to be resolved. If the result of evaluation is not a Promise, it's considered to be an error.
Return object
result Run result.
exceptionDetailsOptional
Exception details.
Events
Runtime.consoleAPICalled #
Issued when console API was called.
We use the @cdp Runtime.consoleAPICalled context parameter to
mark synthetic messages generated by the backend, i.e. not
originating in a real console.* API call.
Parameters
type stringType of the call.
Allowed values: log, debug, info, error, warning, dir, dirxml, table, trace, clear, startGroup, startGroupCollapsed, endGroup, assert, profile, profileEnd
args array[ RemoteObject ]Call arguments.
executionContextId Identifier of the context where the call was made.
timestamp Call timestamp.
stackTraceOptional
Stack trace captured when the call was made.
Runtime.exceptionRevoked #
Issued when unhandled exception was revoked.
Parameters
reason stringReason describing why exception was revoked.
exceptionId integerThe id of revoked exception, as reported in exceptionUnhandled.
Runtime.exceptionThrown #
Issued when exception was thrown and unhandled.
Parameters
timestamp Timestamp of the exception.
exceptionDetails Runtime.executionContextCreated #
Issued when new execution context is created.
Parameters
context A newly created execution contex.
Runtime.executionContextDestroyed #
Issued when execution context is destroyed.
Parameters
executionContextId Id of the destroyed context
Runtime.inspectRequested #
Issued when object should be inspected (for example, as a result of inspect() command line API call).
Parameters
object hints objectTypes
Runtime.CallArgument #
Represents function call argument. Either remote object id objectId, primitive value, unserializable primitive value or neither of (for undefined) them should be specified.
Type: object
Properties
valueOptional
anyPrimitive value.
unserializableValueOptional
Primitive value which can not be JSON-stringified.
objectIdOptional
Remote object handle.
Runtime.CallFrame #
Stack entry for runtime errors and assertions.
Type: object
Properties
functionName stringJavaScript function name.
scriptId JavaScript script id.
url stringJavaScript script name or url.
lineNumber integerJavaScript script line number (0-based).
columnNumber integerJavaScript script column number (0-based).
Runtime.ExceptionDetails #
Detailed information about exception (or error) that was thrown during script compilation or execution.
Type: object
Properties
exceptionId integerException id.
text stringException text, which should be used together with exception object when available.
lineNumber integerLine number of the exception location (0-based).
columnNumber integerColumn number of the exception location (0-based).
scriptIdOptional
Script ID of the exception location.
urlOptional
stringURL of the exception location, to be used when the script was not reported.
stackTraceOptional
JavaScript stack trace if available.
exceptionOptional
Exception object if available.
executionContextIdOptional
Identifier of the context where exception happened.
Runtime.ExecutionContextDescription #
Description of an isolated world.
Type: object
Properties
id Unique id of the execution context. It can be used to specify in which execution context script evaluation should be performed.
origin stringExecution context origin.
name stringHuman readable name describing given context.
auxDataOptional
objectEmbedder-specific auxiliary data.
Runtime.InternalPropertyDescriptor #
Object internal property descriptor. This property isn't normally visible in JavaScript code.
Type: object
Properties
name stringConventional property name.
valueOptional
The value associated with the property.
Runtime.PropertyDescriptor #
Object property descriptor.
Type: object
Properties
name stringProperty name or symbol description.
valueOptional
The value associated with the property.
writableOptional
booleanTrue if the value associated with the property may be changed (data descriptors only).
getOptional
A function which serves as a getter for the property, or undefined if there is no getter (accessor descriptors only).
setOptional
A function which serves as a setter for the property, or undefined if there is no setter (accessor descriptors only).
configurable booleanTrue if the type of this property descriptor may be changed and if the property may be deleted from the corresponding object.
enumerable booleanTrue if this property shows up during enumeration of the properties on the corresponding object.
wasThrownOptional
booleanTrue if the result was thrown during the evaluation.
isOwnOptional
booleanTrue if the property is owned for the object.
symbolOptional
Property symbol object, if the property is of the symbol type.
Runtime.RemoteObject #
Mirror object referencing original JavaScript object.
Type: object
Runtime.RemoteObject's description property is a string, but in the case of functions, V8 populates it with the result of toString [1] and Chrome DevTools uses a series of regexes [2] to extract structured information about the function. [1] https://source.chromium.org/chromium/chromium/src/+/main:v8/src/debug/debug-interface.cc;l=138-174;drc=42debe0b0e6bf90175dd0d121eb0e7dc11a6d29c [2] https://github.com/facebookexperimental/rn-chrome-devtools-frontend/blob/9a23d4c7c4c2d1a3d9e913af38d6965f474c4284/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts#L311-L391
Properties
type stringObject type.
Allowed values: object, function, undefined, string, number, boolean, symbol
subtypeOptional
stringObject subtype hint. Specified for object type values only.
Allowed values: array, null, node, regexp, date, map, set, iterator, generator, error, proxy, promise, typedarray
classNameOptional
stringObject class (constructor) name. Specified for object type values only.
valueOptional
anyRemote object value in case of primitive values or JSON values (if it was requested).
unserializableValueOptional
Primitive value which can not be JSON-stringified does not have value, but gets this property.
descriptionOptional
stringString representation of the object.
objectIdOptional
Unique object identifier (for non-primitive values).
previewOptional
Preview containing abbreviated property values. Specified for object type values only.
customPreviewOptional
Runtime.StackTrace #
Call frames for assertions or error messages.
Type: object
Properties
descriptionOptional
stringString label of this stack trace. For async traces this may be a name of the function that initiated the async call.
callFrames array[ CallFrame ]JavaScript function name.
parentOptional
Asynchronous JavaScript stack trace that preceded this stack, if available.
Runtime.UnserializableValue #
Primitive value which cannot be JSON-stringified.
Type: string
Allowed values: Infinity, NaN, -Infinity, -0