Chrome Remote Interface v0.4.1 ChromeRemoteInterface.RPC.Runtime View Source

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.

Link to this section Summary

Functions

Add handler to promise with given promise object id.

Calls function with given declaration on the given object. Object group of the result is inherited from the target object.

Compiles expression.

Disables reporting of execution contexts creation.

Discards collected exceptions and console API calls.

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.

Evaluates expression on global object.

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

Returns all let, const and class variables from global scope.

Parameters: prototypeObjectId - - Identifier of the prototype to return objects for.objectGroup - - Symbolic group name that can be used to release the results.

Releases remote object with given id.

Releases all remote objects that belong to a given group.

Tells inspected instance to run if it was waiting for debugger to attach.

Runs script with given id in a given context.

Enables or disables async call stacks tracking.

Link to this section Functions

Add handler to promise with given promise object id.

Parameters: promiseObjectId - - Identifier of the promise.returnByValue - - Whether the result is expected to be a JSON object that should be sent by value.generatePreview - - Whether preview should be generated for the result.

Link to this function

awaitPromise(page_pid, parameters) View Source

Link to this function

awaitPromise(page_pid, parameters, opts) View Source

Link to this function

callFunctionOn(page_pid) View Source

Calls function with given declaration on the given object. Object group of the result is inherited from the target object.

Parameters: functionDeclaration - - Declaration of the function to call.objectId - - Identifier of the object to call function on. Either objectId or executionContextId should be specified.arguments - - Call arguments. All call arguments must belong to the same JavaScript world as the target object.silent - - In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state.returnByValue - - Whether the result is expected to be a JSON object which should be sent by value.generatePreview - - Whether preview should be generated for the result.userGesture - - Whether execution should be treated as initiated by user in the UI.awaitPromise - - Whether execution should await for resulting value and return once awaited promise is resolved.executionContextId - - Specifies execution context which global object will be used to call function on. Either executionContextId or objectId should be specified.objectGroup - - Symbolic group name that can be used to release multiple objects. If objectGroup is not specified and objectId is, objectGroup will be inherited from object.

Link to this function

callFunctionOn(page_pid, parameters) View Source

Link to this function

callFunctionOn(page_pid, parameters, opts) View Source

Compiles expression.

Parameters: expression - - Expression to compile.sourceURL - - Source url to be set for the script.persistScript - - Specifies whether the compiled script should be persisted.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.

Link to this function

compileScript(page_pid, parameters) View Source

Link to this function

compileScript(page_pid, parameters, opts) View Source

Disables reporting of execution contexts creation.

Parameters:

Link to this function

disable(page_pid, parameters) View Source

Link to this function

disable(page_pid, parameters, opts) View Source

Link to this function

discardConsoleEntries(page_pid) View Source

Discards collected exceptions and console API calls.

Parameters:

Link to this function

discardConsoleEntries(page_pid, parameters) View Source

Link to this function

discardConsoleEntries(page_pid, parameters, opts) View Source

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.

Parameters:

Link to this function

enable(page_pid, parameters) View Source

Link to this function

enable(page_pid, parameters, opts) View Source

Evaluates expression on global object.

Parameters: expression - - Expression to evaluate.objectGroup - - Symbolic group name that can be used to release multiple objects.includeCommandLineAPI - - Determines whether Command Line API should be available during the evaluation.silent - - In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state.contextId - - 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 - - Whether the result is expected to be a JSON object that should be sent by value.generatePreview - - Whether preview should be generated for the result.userGesture - - Whether execution should be treated as initiated by user in the UI.awaitPromise - - Whether execution should await for resulting value and return once awaited promise is resolved.throwOnSideEffect - - Whether to throw an exception if side effect cannot be ruled out during evaluation.timeout - - Terminate execution after timing out (number of milliseconds).

Link to this function

evaluate(page_pid, parameters) View Source

Link to this function

evaluate(page_pid, parameters, opts) View Source

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

Parameters: objectId - - Identifier of the object to return properties for.ownProperties - - If true, returns properties belonging only to the element itself, not to its prototype chain.accessorPropertiesOnly - - If true, returns accessor properties (with getter/setter) only; internal properties are not returned either.generatePreview - - Whether preview should be generated for the results.

Link to this function

getProperties(page_pid, parameters) View Source

Link to this function

getProperties(page_pid, parameters, opts) View Source

Link to this function

globalLexicalScopeNames(page_pid) View Source

Returns all let, const and class variables from global scope.

Parameters: executionContextId - - Specifies in which execution context to lookup global scope variables.

Link to this function

globalLexicalScopeNames(page_pid, parameters) View Source

Link to this function

globalLexicalScopeNames(page_pid, parameters, opts) View Source

Parameters: prototypeObjectId - - Identifier of the prototype to return objects for.objectGroup - - Symbolic group name that can be used to release the results.

Link to this function

queryObjects(page_pid, parameters) View Source

Link to this function

queryObjects(page_pid, parameters, opts) View Source

Releases remote object with given id.

Parameters: objectId - - Identifier of the object to release.

Link to this function

releaseObject(page_pid, parameters) View Source

Link to this function

releaseObject(page_pid, parameters, opts) View Source

Link to this function

releaseObjectGroup(page_pid) View Source

Releases all remote objects that belong to a given group.

Parameters: objectGroup - - Symbolic object group name.

Link to this function

releaseObjectGroup(page_pid, parameters) View Source

Link to this function

releaseObjectGroup(page_pid, parameters, opts) View Source

Link to this function

runIfWaitingForDebugger(page_pid) View Source

Tells inspected instance to run if it was waiting for debugger to attach.

Parameters:

Link to this function

runIfWaitingForDebugger(page_pid, parameters) View Source

Link to this function

runIfWaitingForDebugger(page_pid, parameters, opts) View Source

Runs script with given id in a given context.

Parameters: scriptId - - Id of the script to run.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 - - Symbolic group name that can be used to release multiple objects.silent - - In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state.includeCommandLineAPI - - Determines whether Command Line API should be available during the evaluation.returnByValue - - Whether the result is expected to be a JSON object which should be sent by value.generatePreview - - Whether preview should be generated for the result.awaitPromise - - Whether execution should await for resulting value and return once awaited promise is resolved.

Link to this function

runScript(page_pid, parameters) View Source

Link to this function

runScript(page_pid, parameters, opts) View Source

Link to this function

setAsyncCallStackDepth(page_pid) View Source

Enables or disables async call stacks tracking.

Parameters: maxDepth - - Maximum depth of async call stacks. Setting to 0 will effectively disable collecting async call stacks (default).

Link to this function

setAsyncCallStackDepth(page_pid, parameters) View Source

Link to this function

setAsyncCallStackDepth(page_pid, parameters, opts) View Source