Domains Accessibility Animation ApplicationCache CSS CacheStorage Console DOM DOMDebugger DOMStorage Database Debugger DeviceOrientation Emulation FileSystem HeapProfiler IndexedDB Input Inspector LayerTree Memory Network Page Power Profiler Rendering Runtime ScreenOrientation Security ServiceWorker Timeline Tracing Worker
Chrome Debugger Protocol Viewer

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

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.
doNotPauseOnExceptionsAndMuteConsole
boolean Specifies whether evaluation should stop on exceptions and mute console. Overrides setPauseOnException state.
contextId
ExecutionContextId Specifies in which isolated context to perform evaluation. Each content script lives in an isolated context and this parameter may be used to specify one of those contexts. If the parameter is omitted or 0 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.
Return object
result
RemoteObject Evaluation result.
wasThrown
boolean True if the result was thrown during the evaluation.
exceptionDetails
Debugger.ExceptionDetails Exception details.

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.
Array element:
Call argument.
doNotPauseOnExceptionsAndMuteConsole
boolean Specifies whether function call should stop on exceptions and mute console. Overrides setPauseOnException 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.
Return object
result
RemoteObject Call result.
wasThrown
boolean True if the result was thrown during the evaluation.

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.
generatePreview
boolean Whether preview should be generated for the results.
Return object
result
array [ PropertyDescriptor ] Object properties.
internalProperties
array [ InternalPropertyDescriptor ] Internal object properties (only of the element itself).
exceptionDetails
Debugger.ExceptionDetails Exception details.

releaseObject

Releases remote object with given id.

Parameters
objectId
RemoteObjectId Identifier of the object to release.

releaseObjectGroup

Releases all remote objects that belong to a given group.

Parameters
objectGroup
string Symbolic object group name.

run

Tells inspected instance(worker or page) that it can run in case it was started paused.

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.

disable

Disables reporting of execution contexts creation.

isRunRequired

Return object
result
boolean True if the Runtime is in paused on start state.

setCustomObjectFormatterEnabled

Parameters
enabled
boolean

Events

executionContextCreated

Issued when new execution context is created.

Parameters
context
ExecutionContextDescription A newly created execution contex.

executionContextDestroyed

Issued when execution context is destroyed.

Parameters
executionContextId
ExecutionContextId Id of the destroyed context

executionContextsCleared

Issued when all executionContexts were cleared in browser

Types

RemoteObjectId

Unique object identifier.

Type: string

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 object type values only. Allowed values: array, null, node, regexp, date, map, set, iterator, generator, error.
className
string Object class (constructor) name. Specified for object type values only.
value
any Remote object value in case of primitive values or JSON values (if it was requested), or description string if the value can not be JSON-stringified (like NaN, Infinity, -Infinity, -0).
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 object type values only.
customPreview
CustomPreview

CustomPreview

Type: object

Properties
header
string
hasBody
boolean
formatterObjectId
RemoteObjectId
configObjectId
RemoteObjectId

ObjectPreview

Object containing abbreviated remote object value.

Type: object

Properties
type
string Object type. Allowed values: object, function, undefined, string, number, boolean, symbol.
subtype
string Object subtype hint. Specified for object type values only. Allowed values: array, null, node, regexp, date, map, set, iterator, generator, error.
description
string String representation of the object.
lossless
boolean Determines whether preview is lossless (contains all information of the original object).
overflow
boolean True iff some of the properties or entries of the original object did not fit.
properties
array [ PropertyPreview ] List of the properties.
entries
array [ EntryPreview ] List of the entries. Specified for map and set subtype values only.

PropertyPreview

Type: object

Properties
name
string Property name.
type
string Object type. Accessor means that the property itself is an accessor property. Allowed values: object, function, undefined, string, number, boolean, symbol, accessor.
value
string User-friendly property value string.
valuePreview
ObjectPreview Nested value preview.
subtype
string Object subtype hint. Specified for object type values only. Allowed values: array, null, node, regexp, date, map, set, iterator, generator, error.

EntryPreview

Type: object

Properties
key
ObjectPreview Preview of the key. Specified for map-like collection entries.
value
ObjectPreview Preview of the value.

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 undefined if there is no getter (accessor descriptors only).
set
RemoteObject A function which serves as a setter for the property, or undefined 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 symbol type.

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.

CallArgument

Represents function call argument. Either remote object id objectId or primitive value or neither of (for undefined) them should be specified.

Type: object

Properties
value
any Primitive value, or description string if the value can not be JSON-stringified (like NaN, Infinity, -Infinity, -0).
objectId
RemoteObjectId Remote object handle.
type
string Object type. Allowed values: object, function, undefined, string, number, boolean, symbol.

ExecutionContextId

Id of an execution context.

Type: integer

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.
type
string Context type. It is used e.g. to distinguish content scripts from web page script.
origin
string Execution context origin.
name
string Human readable name describing given context.
frameId
string Id of the owning frame. May be an empty string if the context is not associated with a frame.