pl.wendigo.chrome.api.runtime / RuntimeOperations

RuntimeOperations

class RuntimeOperations (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
Protocol Runtime domain documentation.

Functions

addBinding

fun addBinding(input: AddBindingRequest): Single<ResponseFrame>

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.

awaitPromise

fun awaitPromise(input: AwaitPromiseRequest): Single<AwaitPromiseResponse>

Add handler to promise with given promise object id.

bindingCalled

fun bindingCalled(): Flowable<BindingCalledEvent>

Notification is issued every time when binding is called.

callFunctionOn

fun callFunctionOn(input: CallFunctionOnRequest): Single<CallFunctionOnResponse>

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

compileScript

fun compileScript(input: CompileScriptRequest): Single<CompileScriptResponse>

Compiles expression.

consoleAPICalled

fun consoleAPICalled(): Flowable<ConsoleAPICalledEvent>

Issued when console API was called.

disable

fun disable(): Single<ResponseFrame>

Disables reporting of execution contexts creation.

discardConsoleEntries

fun discardConsoleEntries(): Single<ResponseFrame>

Discards collected exceptions and console API calls.

enable

fun enable(): Single<ResponseFrame>

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.

evaluate

fun evaluate(input: EvaluateRequest): Single<EvaluateResponse>

Evaluates expression on global object.

events

fun events(): Flowable<Event>

Returns flowable capturing all Runtime domains events.

exceptionRevoked

fun exceptionRevoked(): Flowable<ExceptionRevokedEvent>

Issued when unhandled exception was revoked.

exceptionThrown

fun exceptionThrown(): Flowable<ExceptionThrownEvent>

Issued when exception was thrown and unhandled.

executionContextCreated

fun executionContextCreated(): Flowable<ExecutionContextCreatedEvent>

Issued when new execution context is created.

executionContextDestroyed

fun executionContextDestroyed(): Flowable<ExecutionContextDestroyedEvent>

Issued when execution context is destroyed.

executionContextsCleared

fun executionContextsCleared(): Flowable<Event>

Issued when all executionContexts were cleared in browser

getHeapUsage

fun getHeapUsage(): Single<GetHeapUsageResponse>

Returns the JavaScript heap usage. It is the total usage of the corresponding isolate not scoped to a particular Runtime.

getIsolateId

fun getIsolateId(): Single<GetIsolateIdResponse>

Returns the isolate id.

getProperties

fun getProperties(input: GetPropertiesRequest): Single<GetPropertiesResponse>

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

globalLexicalScopeNames

fun globalLexicalScopeNames(input: GlobalLexicalScopeNamesRequest): Single<GlobalLexicalScopeNamesResponse>

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

inspectRequested

fun inspectRequested(): Flowable<InspectRequestedEvent>

Issued when object should be inspected (for example, as a result of inspect() command line API call).

queryObjects

fun queryObjects(input: QueryObjectsRequest): Single<QueryObjectsResponse>

releaseObject

fun releaseObject(input: ReleaseObjectRequest): Single<ResponseFrame>

Releases remote object with given id.

releaseObjectGroup

fun releaseObjectGroup(input: ReleaseObjectGroupRequest): Single<ResponseFrame>

Releases all remote objects that belong to a given group.

removeBinding

fun removeBinding(input: RemoveBindingRequest): Single<ResponseFrame>

This method does not remove binding function from global object but unsubscribes current runtime agent from Runtime.bindingCalled notifications.

runIfWaitingForDebugger

fun runIfWaitingForDebugger(): Single<ResponseFrame>

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

runScript

fun runScript(input: RunScriptRequest): Single<RunScriptResponse>

Runs script with given id in a given context.

setAsyncCallStackDepth

fun setAsyncCallStackDepth(input: SetAsyncCallStackDepthRequest): Single<ResponseFrame>

Enables or disables async call stacks tracking.

setCustomObjectFormatterEnabled

fun setCustomObjectFormatterEnabled(input: SetCustomObjectFormatterEnabledRequest): Single<ResponseFrame>

setMaxCallStackSizeToCapture

fun setMaxCallStackSizeToCapture(input: SetMaxCallStackSizeToCaptureRequest): Single<ResponseFrame>

terminateExecution

fun terminateExecution(): Single<ResponseFrame>

Terminate current or next JavaScript execution. Will cancel the termination when the outer-most script execution ends.