public interface Runtime
Modifier and Type | Method | Description |
---|---|---|
void |
addBinding(String name) |
If executionContextId is empty, adds binding with the given name on the
global objects of all inspected contexts, including those created later,
bindings survive reloads.
|
void |
addBinding(String name,
Integer executionContextId) |
If executionContextId is empty, adds binding with the given name on the
global objects of all inspected contexts, including those created later,
bindings survive reloads.
|
AwaitPromiseResult |
awaitPromise(String promiseObjectId) |
Add handler to promise with given promise object id.
|
AwaitPromiseResult |
awaitPromise(String promiseObjectId,
Boolean returnByValue,
Boolean generatePreview) |
Add handler to promise with given promise object id.
|
CallFunctionOnResult |
callFunctionOn(String functionDeclaration) |
Calls function with given declaration on the given object.
|
CallFunctionOnResult |
callFunctionOn(String functionDeclaration,
String objectId,
List<CallArgument> arguments,
Boolean silent,
Boolean returnByValue,
Boolean generatePreview,
Boolean userGesture,
Boolean awaitPromise,
Integer executionContextId,
String objectGroup) |
Calls function with given declaration on the given object.
|
CompileScriptResult |
compileScript(String expression,
String sourceURL,
Boolean persistScript) |
Compiles expression.
|
CompileScriptResult |
compileScript(String expression,
String sourceURL,
Boolean persistScript,
Integer executionContextId) |
Compiles expression.
|
void |
disable() |
Disables reporting of execution contexts creation.
|
void |
discardConsoleEntries() |
Discards collected exceptions and console API calls.
|
void |
enable() |
Enables reporting of execution contexts creation by means of
executionContextCreated event. |
EvaluateResult |
evaluate(String expression) |
Evaluates expression on global object.
|
EvaluateResult |
evaluate(String expression,
String objectGroup,
Boolean includeCommandLineAPI,
Boolean silent,
Integer contextId,
Boolean returnByValue,
Boolean generatePreview,
Boolean userGesture,
Boolean awaitPromise,
Boolean throwOnSideEffect,
Double timeout) |
Evaluates expression on global object.
|
GetHeapUsageResult |
getHeapUsage() |
Returns the JavaScript heap usage.
|
String |
getIsolateId() |
Returns the isolate id.
|
GetPropertiesResult |
getProperties(String objectId) |
Returns properties of a given object.
|
GetPropertiesResult |
getProperties(String objectId,
Boolean ownProperties,
Boolean accessorPropertiesOnly,
Boolean generatePreview) |
Returns properties of a given object.
|
List<String> |
globalLexicalScopeNames() |
Returns all let, const and class variables from global scope.
|
List<String> |
globalLexicalScopeNames(Integer executionContextId) |
Returns all let, const and class variables from global scope.
|
RemoteObject |
queryObjects(String prototypeObjectId) |
|
RemoteObject |
queryObjects(String prototypeObjectId,
String objectGroup) |
|
void |
releaseObject(String objectId) |
Releases remote object with given id.
|
void |
releaseObjectGroup(String objectGroup) |
Releases all remote objects that belong to a given group.
|
void |
removeBinding(String name) |
This method does not remove binding function from global object but
unsubscribes current runtime agent from Runtime.bindingCalled notifications.
|
void |
runIfWaitingForDebugger() |
Tells inspected instance to run if it was waiting for debugger to attach.
|
RunScriptResult |
runScript(String scriptId) |
Runs script with given id in a given context.
|
RunScriptResult |
runScript(String scriptId,
Integer executionContextId,
String objectGroup,
Boolean silent,
Boolean includeCommandLineAPI,
Boolean returnByValue,
Boolean generatePreview,
Boolean awaitPromise) |
Runs script with given id in a given context.
|
void |
setAsyncCallStackDepth(Integer maxDepth) |
Enables or disables async call stacks tracking.
|
void |
setCustomObjectFormatterEnabled(Boolean enabled) |
|
void |
setMaxCallStackSizeToCapture(Integer size) |
|
void |
terminateExecution() |
Terminate current or next JavaScript execution.
|
AwaitPromiseResult awaitPromise(String promiseObjectId, Boolean returnByValue, Boolean generatePreview)
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.CallFunctionOnResult callFunctionOn(String functionDeclaration, String objectId, List<CallArgument> arguments, Boolean silent, Boolean returnByValue, Boolean generatePreview, Boolean userGesture, Boolean awaitPromise, Integer executionContextId, String objectGroup)
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.CompileScriptResult compileScript(String expression, String sourceURL, Boolean persistScript, Integer executionContextId)
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.void disable()
void discardConsoleEntries()
void enable()
executionContextCreated
event.
When the reporting gets enabled the event will be sent immediately for each existing execution
context.EvaluateResult evaluate(String expression, String objectGroup, Boolean includeCommandLineAPI, Boolean silent, Integer contextId, Boolean returnByValue, Boolean generatePreview, Boolean userGesture, Boolean awaitPromise, Boolean throwOnSideEffect, Double timeout)
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).String getIsolateId()
GetHeapUsageResult getHeapUsage()
GetPropertiesResult getProperties(String objectId, Boolean ownProperties, Boolean accessorPropertiesOnly, Boolean generatePreview)
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.List<String> globalLexicalScopeNames(Integer executionContextId)
executionContextId
- Specifies in which execution context to lookup global scope variables.RemoteObject queryObjects(String prototypeObjectId, String objectGroup)
void releaseObject(String objectId)
objectId
- Identifier of the object to release.void releaseObjectGroup(String objectGroup)
objectGroup
- Symbolic object group name.void runIfWaitingForDebugger()
RunScriptResult runScript(String scriptId, Integer executionContextId, String objectGroup, Boolean silent, Boolean includeCommandLineAPI, Boolean returnByValue, Boolean generatePreview, Boolean awaitPromise)
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.void setAsyncCallStackDepth(Integer maxDepth)
maxDepth
- Maximum depth of async call stacks. Setting to 0
will effectively disable collecting async
call stacks (default).void setCustomObjectFormatterEnabled(Boolean enabled)
void setMaxCallStackSizeToCapture(Integer size)
void terminateExecution()
void addBinding(String name, Integer executionContextId)
void removeBinding(String name)
AwaitPromiseResult awaitPromise(String promiseObjectId)
promiseObjectId
- Identifier of the promise.CallFunctionOnResult callFunctionOn(String functionDeclaration)
functionDeclaration
- Declaration of the function to call.CompileScriptResult compileScript(String expression, String sourceURL, Boolean persistScript)
expression
- Expression to compile.sourceURL
- Source url to be set for the script.persistScript
- Specifies whether the compiled script should be persisted.EvaluateResult evaluate(String expression)
expression
- Expression to evaluate.GetPropertiesResult getProperties(String objectId)
objectId
- Identifier of the object to return properties for.List<String> globalLexicalScopeNames()
RemoteObject queryObjects(String prototypeObjectId)
RunScriptResult runScript(String scriptId)
scriptId
- Id of the script to run.void addBinding(String name)
Copyright © 2017, 2018–2018 WebFolder OÜ. All rights reserved.