-
public final class RuntimeDomainRuntime 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.
-
-
Method Summary
Modifier and Type Method Description final Flow<RuntimeEvent>events()Subscribes to all events related to this domain. final Flow<RuntimeEvent.BindingCalledEvent>bindingCalled()Notification is issued every time when binding is called. final Flow<RuntimeEvent.ConsoleAPICalledEvent>consoleAPICalled()Issued when console API was called. final Flow<RuntimeEvent.ExceptionRevokedEvent>exceptionRevoked()Issued when unhandled exception was revoked. final Flow<RuntimeEvent.ExceptionThrownEvent>exceptionThrown()Issued when exception was thrown and unhandled. final Flow<RuntimeEvent.ExecutionContextCreatedEvent>executionContextCreated()Issued when new execution context is created. final Flow<RuntimeEvent.ExecutionContextDestroyedEvent>executionContextDestroyed()Issued when execution context is destroyed. final Flow<RuntimeEvent.ExecutionContextsClearedEvent>executionContextsCleared()Issued when all executionContexts were cleared in browserOfficial doc final Flow<RuntimeEvent.InspectRequestedEvent>inspectRequested()Issued when object should be inspected (for example, as a result of inspect() command line API call). final AwaitPromiseResponseawaitPromise(AwaitPromiseRequest input)Add handler to promise with given promise object id. final CallFunctionOnResponsecallFunctionOn(CallFunctionOnRequest input)Calls function with given declaration on the given object. final CompileScriptResponsecompileScript(CompileScriptRequest input)Compiles expression. final Unitdisable()Disables reporting of execution contexts creation. final UnitdiscardConsoleEntries()Discards collected exceptions and console API calls. final Unitenable()Enables reporting of execution contexts creation by means of executionContextCreatedevent.final EvaluateResponseevaluate(EvaluateRequest input)Evaluates expression on global object. final GetIsolateIdResponsegetIsolateId()Returns the isolate id. final GetHeapUsageResponsegetHeapUsage()Returns the JavaScript heap usage. final GetPropertiesResponsegetProperties(GetPropertiesRequest input)Returns properties of a given object. final GlobalLexicalScopeNamesResponseglobalLexicalScopeNames(GlobalLexicalScopeNamesRequest input)Returns all let, const and class variables from global scope. final QueryObjectsResponsequeryObjects(QueryObjectsRequest input)Official doc final UnitreleaseObject(ReleaseObjectRequest input)Releases remote object with given id. final UnitreleaseObjectGroup(ReleaseObjectGroupRequest input)Releases all remote objects that belong to a given group. final UnitrunIfWaitingForDebugger()Tells inspected instance to run if it was waiting for debugger to attach. final RunScriptResponserunScript(RunScriptRequest input)Runs script with given id in a given context. final UnitsetAsyncCallStackDepth(SetAsyncCallStackDepthRequest input)Enables or disables async call stacks tracking. final UnitsetCustomObjectFormatterEnabled(SetCustomObjectFormatterEnabledRequest input)Official doc final UnitsetMaxCallStackSizeToCapture(SetMaxCallStackSizeToCaptureRequest input)Official doc final UnitterminateExecution()Terminate current or next JavaScript execution. final UnitaddBinding(AddBindingRequest input)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. final UnitremoveBinding(RemoveBindingRequest input)This method does not remove binding function from global object but unsubscribes current runtime agent from Runtime.bindingCalled notifications. -
-
Method Detail
-
events
final Flow<RuntimeEvent> events()
Subscribes to all events related to this domain.
-
bindingCalled
final Flow<RuntimeEvent.BindingCalledEvent> bindingCalled()
Notification is issued every time when binding is called.
-
consoleAPICalled
final Flow<RuntimeEvent.ConsoleAPICalledEvent> consoleAPICalled()
Issued when console API was called.
-
exceptionRevoked
final Flow<RuntimeEvent.ExceptionRevokedEvent> exceptionRevoked()
Issued when unhandled exception was revoked.
-
exceptionThrown
final Flow<RuntimeEvent.ExceptionThrownEvent> exceptionThrown()
Issued when exception was thrown and unhandled.
-
executionContextCreated
final Flow<RuntimeEvent.ExecutionContextCreatedEvent> executionContextCreated()
Issued when new execution context is created.
-
executionContextDestroyed
final Flow<RuntimeEvent.ExecutionContextDestroyedEvent> executionContextDestroyed()
Issued when execution context is destroyed.
-
executionContextsCleared
final Flow<RuntimeEvent.ExecutionContextsClearedEvent> executionContextsCleared()
Issued when all executionContexts were cleared in browser
-
inspectRequested
final Flow<RuntimeEvent.InspectRequestedEvent> inspectRequested()
Issued when object should be inspected (for example, as a result of inspect() command line API call).
-
awaitPromise
final AwaitPromiseResponse awaitPromise(AwaitPromiseRequest input)
Add handler to promise with given promise object id.
-
callFunctionOn
final CallFunctionOnResponse callFunctionOn(CallFunctionOnRequest input)
Calls function with given declaration on the given object. Object group of the result is inherited from the target object.
-
compileScript
final CompileScriptResponse compileScript(CompileScriptRequest input)
Compiles expression.
-
discardConsoleEntries
final Unit discardConsoleEntries()
Discards collected exceptions and console API calls.
-
enable
final Unit enable()
Enables reporting of execution contexts creation by means of
executionContextCreatedevent. When the reporting gets enabled the event will be sent immediately for each existing execution context.
-
evaluate
final EvaluateResponse evaluate(EvaluateRequest input)
Evaluates expression on global object.
-
getIsolateId
final GetIsolateIdResponse getIsolateId()
Returns the isolate id.
-
getHeapUsage
final GetHeapUsageResponse getHeapUsage()
Returns the JavaScript heap usage. It is the total usage of the corresponding isolate not scoped to a particular Runtime.
-
getProperties
final GetPropertiesResponse getProperties(GetPropertiesRequest input)
Returns properties of a given object. Object group of the result is inherited from the target object.
-
globalLexicalScopeNames
final GlobalLexicalScopeNamesResponse globalLexicalScopeNames(GlobalLexicalScopeNamesRequest input)
Returns all let, const and class variables from global scope.
-
queryObjects
final QueryObjectsResponse queryObjects(QueryObjectsRequest input)
-
releaseObject
final Unit releaseObject(ReleaseObjectRequest input)
Releases remote object with given id.
-
releaseObjectGroup
final Unit releaseObjectGroup(ReleaseObjectGroupRequest input)
Releases all remote objects that belong to a given group.
-
runIfWaitingForDebugger
final Unit runIfWaitingForDebugger()
Tells inspected instance to run if it was waiting for debugger to attach.
-
runScript
final RunScriptResponse runScript(RunScriptRequest input)
Runs script with given id in a given context.
-
setAsyncCallStackDepth
final Unit setAsyncCallStackDepth(SetAsyncCallStackDepthRequest input)
Enables or disables async call stacks tracking.
-
setCustomObjectFormatterEnabled
final Unit setCustomObjectFormatterEnabled(SetCustomObjectFormatterEnabledRequest input)
-
setMaxCallStackSizeToCapture
final Unit setMaxCallStackSizeToCapture(SetMaxCallStackSizeToCaptureRequest input)
-
terminateExecution
final Unit terminateExecution()
Terminate current or next JavaScript execution. Will cancel the termination when the outer-most script execution ends.
-
addBinding
final Unit addBinding(AddBindingRequest input)
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. If executionContextId is specified, adds binding only on global object of given execution context. Binding function takes exactly one argument, this argument should be string, in case of any other input, function throws an exception. Each binding function call produces Runtime.bindingCalled notification.
-
removeBinding
final Unit removeBinding(RemoveBindingRequest input)
This method does not remove binding function from global object but unsubscribes current runtime agent from Runtime.bindingCalled notifications.
-
-
-
-