callFunctionOn

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


suspend fun callFunctionOn(functionDeclaration: String, objectId: String? = null, arguments: List<Runtime.CallArgument>? = null, silent: Boolean? = null, returnByValue: Boolean? = null, generatePreview: Boolean? = null, userGesture: Boolean? = null, awaitPromise: Boolean? = null, executionContextId: Int? = null, objectGroup: String? = null, throwOnSideEffect: Boolean? = null, uniqueContextId: String? = null, serializationOptions: Runtime.SerializationOptions? = null): Runtime.CallFunctionOnReturn

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. Can be overriden by serializationOptions.

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.

throwOnSideEffect

Whether to throw an exception if side effect cannot be ruled out during evaluation.

uniqueContextId

An alternative way to specify the execution context to call function on. Compared to contextId that may be reused across processes, this is guaranteed to be system-unique, so it can be used to prevent accidental function call in context different than intended (e.g. as a result of navigation across process boundaries). This is mutually exclusive with executionContextId.

serializationOptions

Specifies the result serialization. If provided, overrides generatePreview and returnByValue.