public interface Runtime
| Modifier and Type | Method and 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.
|
AwaitPromise |
awaitPromise(String promiseObjectId)
Add handler to promise with given promise object id.
|
AwaitPromise |
awaitPromise(String promiseObjectId,
Boolean returnByValue,
Boolean generatePreview)
Add handler to promise with given promise object id.
|
CallFunctionOn |
callFunctionOn(String functionDeclaration)
Calls function with given declaration on the given object.
|
CallFunctionOn |
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.
|
CompileScript |
compileScript(String expression,
String sourceURL,
Boolean persistScript)
Compiles expression.
|
CompileScript |
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.
|
Evaluate |
evaluate(String expression)
Evaluates expression on global object.
|
Evaluate |
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.
|
HeapUsage |
getHeapUsage()
Returns the JavaScript heap usage.
|
String |
getIsolateId()
Returns the isolate id.
|
Properties |
getProperties(String objectId)
Returns properties of a given object.
|
Properties |
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.
|
EventListener |
onBindingCalled(EventHandler<BindingCalled> eventListener)
Notification is issued every time when binding is called.
|
EventListener |
onConsoleAPICalled(EventHandler<ConsoleAPICalled> eventListener)
Issued when console API was called.
|
EventListener |
onExceptionRevoked(EventHandler<ExceptionRevoked> eventListener)
Issued when unhandled exception was revoked.
|
EventListener |
onExceptionThrown(EventHandler<ExceptionThrown> eventListener)
Issued when exception was thrown and unhandled.
|
EventListener |
onExecutionContextCreated(EventHandler<ExecutionContextCreated> eventListener)
Issued when new execution context is created.
|
EventListener |
onExecutionContextDestroyed(EventHandler<ExecutionContextDestroyed> eventListener)
Issued when execution context is destroyed.
|
EventListener |
onExecutionContextsCleared(EventHandler<ExecutionContextsCleared> eventListener)
Issued when all executionContexts were cleared in browser
|
EventListener |
onInspectRequested(EventHandler<InspectRequested> eventListener)
Issued when object should be inspected (for example, as a result of inspect() command line API
call).
|
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.
|
RunScript |
runScript(String scriptId)
Runs script with given id in a given context.
|
RunScript |
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 |
setCustomObjectFormatterEnabled(Boolean enabled) |
void |
setMaxCallStackSizeToCapture(Integer size) |
void |
terminateExecution()
Terminate current or next JavaScript execution.
|
AwaitPromise awaitPromise(String promiseObjectId)
promiseObjectId - Identifier of the promise.AwaitPromise 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.CallFunctionOn callFunctionOn(String functionDeclaration)
functionDeclaration - Declaration of the function to call.CallFunctionOn 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.CompileScript 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.CompileScript 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()
Evaluate evaluate(String expression)
expression - Expression to evaluate.Evaluate 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()
HeapUsage getHeapUsage()
Properties getProperties(String objectId)
objectId - Identifier of the object to return properties for.Properties 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()
List<String> globalLexicalScopeNames(Integer executionContextId)
executionContextId - Specifies in which execution context to lookup global scope
variables.RemoteObject queryObjects(String prototypeObjectId)
prototypeObjectId - Identifier of the prototype to return objects for.RemoteObject queryObjects(String prototypeObjectId, String objectGroup)
prototypeObjectId - Identifier of the prototype to return objects for.objectGroup - Symbolic group name that can be used to release the results.void releaseObject(String objectId)
objectId - Identifier of the object to release.void releaseObjectGroup(String objectGroup)
objectGroup - Symbolic object group name.void runIfWaitingForDebugger()
RunScript runScript(String scriptId)
scriptId - Id of the script to run.RunScript 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 setCustomObjectFormatterEnabled(Boolean enabled)
enabled - void setMaxCallStackSizeToCapture(Integer size)
size - void terminateExecution()
void addBinding(String name)
name - void addBinding(String name, Integer executionContextId)
name - executionContextId - void removeBinding(String name)
name - EventListener onBindingCalled(EventHandler<BindingCalled> eventListener)
EventListener onConsoleAPICalled(EventHandler<ConsoleAPICalled> eventListener)
EventListener onExceptionRevoked(EventHandler<ExceptionRevoked> eventListener)
EventListener onExceptionThrown(EventHandler<ExceptionThrown> eventListener)
EventListener onExecutionContextCreated(EventHandler<ExecutionContextCreated> eventListener)
EventListener onExecutionContextDestroyed(EventHandler<ExecutionContextDestroyed> eventListener)
EventListener onExecutionContextsCleared(EventHandler<ExecutionContextsCleared> eventListener)
EventListener onInspectRequested(EventHandler<InspectRequested> eventListener)
Copyright © 2020. All rights reserved.