Chrome DevTools Protocol

Methods

Runtime.awaitPromise

Add handler to promise with given promise object id.

parameters
promiseObjectId
RemoteObjectId

Identifier of the promise.

returnByValue
boolean

Whether the result is expected to be a JSON object that should be sent by value.

generatePreview
boolean

Whether preview should be generated for the result.

Return Object
result
RemoteObject

Promise result. Will contain rejected value if promise was rejected.

exceptionDetails
ExceptionDetails

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.

parameters
objectId
RemoteObjectId

Identifier of the object to call function on.

functionDeclaration
string

Declaration of the function to call.

arguments
array[ CallArgument ]

Call arguments. All call arguments must belong to the same JavaScript world as the target object.

silent
boolean

In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides <code>setPauseOnException</code> state.

returnByValue
boolean

Whether the result is expected to be a JSON object which should be sent by value.

generatePreview
boolean

Whether preview should be generated for the result.

Experimental
userGesture
boolean

Whether execution should be treated as initiated by user in the UI.

Experimental
awaitPromise
boolean

Whether 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
RemoteObject

Call result.

exceptionDetails
ExceptionDetails

Exception details.

Runtime.compileScript

Compiles expression.

parameters
expression
string

Expression to compile.

sourceURL
string

Source url to be set for the script.

persistScript
boolean

Specifies whether the compiled script should be persisted.

executionContextId
ExecutionContextId

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
scriptId
ScriptId

Id of the script.

exceptionDetails
ExceptionDetails

Exception details.

Runtime.disable

Disables reporting of execution contexts creation.

Runtime.discardConsoleEntries

Discards collected exceptions and console API calls.

Runtime.enable

Enables reporting of execution contexts creation by means of <code>executionContextCreated</code> event. When the reporting gets enabled the event will be sent immediately for each existing execution context.

Runtime.evaluate

Evaluates expression on global object.

parameters
expression
string

Expression to evaluate.

objectGroup
string

Symbolic group name that can be used to release multiple objects.

includeCommandLineAPI
boolean

Determines whether Command Line API should be available during the evaluation.

silent
boolean

In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides <code>setPauseOnException</code> state.

contextId
ExecutionContextId

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.

returnByValue
boolean

Whether the result is expected to be a JSON object that should be sent by value.

generatePreview
boolean

Whether preview should be generated for the result.

Experimental
userGesture
boolean

Whether execution should be treated as initiated by user in the UI.

Experimental
awaitPromise
boolean

Whether 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
RemoteObject

Evaluation result.

exceptionDetails
ExceptionDetails

Exception details.

Runtime.getProperties

Returns properties of a given object. Object group of the result is inherited from the target object.

parameters
objectId
RemoteObjectId

Identifier of the object to return properties for.

ownProperties
boolean

If true, returns properties belonging only to the element itself, not to its prototype chain.

accessorPropertiesOnly
boolean

If true, returns accessor properties (with getter/setter) only; internal properties are not returned either.

Experimental
generatePreview
boolean

Whether preview should be generated for the results.

Experimental
Return Object
result
array[ PropertyDescriptor ]

Object properties.

internalProperties
array[ InternalPropertyDescriptor ]

Internal object properties (only of the element itself).

exceptionDetails
ExceptionDetails

Exception details.

Runtime.releaseObject

Releases remote object with given id.

parameters
objectId
RemoteObjectId

Identifier of the object to release.

Runtime.releaseObjectGroup

Releases all remote objects that belong to a given group.

parameters
objectGroup
string

Symbolic 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
ScriptId

Id of the script to run.

executionContextId
ExecutionContextId

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.

objectGroup
string

Symbolic group name that can be used to release multiple objects.

silent
boolean

In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides <code>setPauseOnException</code> state.

includeCommandLineAPI
boolean

Determines whether Command Line API should be available during the evaluation.

returnByValue
boolean

Whether the result is expected to be a JSON object which should be sent by value.

generatePreview
boolean

Whether preview should be generated for the result.

awaitPromise
boolean

Whether 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
RemoteObject

Run result.

exceptionDetails
ExceptionDetails

Exception details.

Events

Runtime.consoleAPICalled

Issued when console API was called.

parameters
type
string

Type 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
ExecutionContextId

Identifier of the context where the call was made.

timestamp
Timestamp

Call timestamp.

stackTrace
StackTrace

Stack trace captured when the call was made.

Runtime.exceptionRevoked

Issued when unhandled exception was revoked.

parameters
reason
string

Reason describing why exception was revoked.

exceptionId
integer

The id of revoked exception, as reported in <code>exceptionUnhandled</code>.

Runtime.exceptionThrown

Issued when exception was thrown and unhandled.

parameters
timestamp
Timestamp

Timestamp of the exception.

exceptionDetails
ExceptionDetails

Runtime.executionContextCreated

Issued when new execution context is created.

parameters
context
ExecutionContextDescription

A newly created execution contex.

Runtime.executionContextDestroyed

Issued when execution context is destroyed.

parameters
executionContextId
ExecutionContextId

Id of the destroyed context

Runtime.executionContextsCleared

Issued when all executionContexts were cleared in browser

Runtime.inspectRequested

Issued when object should be inspected (for example, as a result of inspect() command line API call).

parameters
object
RemoteObject
hints
object

Types

Runtime.CallArgument

Represents function call argument. Either remote object id <code>objectId</code>, primitive <code>value</code>, unserializable primitive value or neither of (for undefined) them should be specified.

Type: object

properties
value
any

Primitive value.

unserializableValue
UnserializableValue

Primitive value which can not be JSON-stringified.

objectId
RemoteObjectId

Remote object handle.

Runtime.CallFrame

Stack entry for runtime errors and assertions.

Type: object

properties
functionName
string

JavaScript function name.

scriptId
ScriptId

JavaScript script id.

url
string

JavaScript script name or url.

lineNumber
integer

JavaScript script line number (0-based).

columnNumber
integer

JavaScript 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
integer

Exception id.

text
string

Exception text, which should be used together with exception object when available.

lineNumber
integer

Line number of the exception location (0-based).

columnNumber
integer

Column number of the exception location (0-based).

scriptId
ScriptId

Script ID of the exception location.

url
string

URL of the exception location, to be used when the script was not reported.

stackTrace
StackTrace

JavaScript stack trace if available.

exception
RemoteObject

Exception object if available.

executionContextId
ExecutionContextId

Identifier of the context where exception happened.

Runtime.ExecutionContextDescription

Description of an isolated world.

Type: object

properties
id
ExecutionContextId

Unique id of the execution context. It can be used to specify in which execution context script evaluation should be performed.

origin
string

Execution context origin.

name
string

Human readable name describing given context.

auxData
object

Embedder-specific auxiliary data.

Runtime.ExecutionContextId

Id of an execution context.

Type: integer

Runtime.InternalPropertyDescriptor

Object internal property descriptor. This property isn't normally visible in JavaScript code.

Type: object

properties
name
string

Conventional property name.

value
RemoteObject

The value associated with the property.

Runtime.PropertyDescriptor

Object property descriptor.

Type: object

properties
name
string

Property name or symbol description.

value
RemoteObject

The value associated with the property.

writable
boolean

True if the value associated with the property may be changed (data descriptors only).

get
RemoteObject

A function which serves as a getter for the property, or <code>undefined</code> if there is no getter (accessor descriptors only).

set
RemoteObject

A function which serves as a setter for the property, or <code>undefined</code> if there is no setter (accessor descriptors only).

configurable
boolean

True if the type of this property descriptor may be changed and if the property may be deleted from the corresponding object.

enumerable
boolean

True if this property shows up during enumeration of the properties on the corresponding object.

wasThrown
boolean

True if the result was thrown during the evaluation.

isOwn
boolean

True if the property is owned for the object.

symbol
RemoteObject

Property symbol object, if the property is of the <code>symbol</code> type.

Runtime.RemoteObject

Mirror object referencing original JavaScript object.

Type: object

properties
type
string

Object type.

Allowed Values: object, function, undefined, string, number, boolean, symbol
subtype
string

Object subtype hint. Specified for <code>object</code> type values only.

Allowed Values: array, null, node, regexp, date, map, set, iterator, generator, error, proxy, promise, typedarray
className
string

Object class (constructor) name. Specified for <code>object</code> type values only.

value
any

Remote object value in case of primitive values or JSON values (if it was requested).

unserializableValue
UnserializableValue

Primitive value which can not be JSON-stringified does not have <code>value</code>, but gets this property.

description
string

String representation of the object.

objectId
RemoteObjectId

Unique object identifier (for non-primitive values).

preview
ObjectPreview

Preview containing abbreviated property values. Specified for <code>object</code> type values only.

Experimental
customPreview
CustomPreview
Experimental

Runtime.RemoteObjectId

Unique object identifier.

Type: string

Runtime.ScriptId

Unique script identifier.

Type: string

Runtime.StackTrace

Call frames for assertions or error messages.

Type: object

properties
description
string

String 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.

parent
StackTrace

Asynchronous JavaScript stack trace that preceded this stack, if available.

Runtime.Timestamp

Number of milliseconds since epoch.

Type: number

Runtime.UnserializableValue

Primitive value which cannot be JSON-stringified.

Allowed Values: Infinity, NaN, -Infinity, -0

Type: string