runScript

suspend fun runScript(args: Runtime.RunScriptParameter, mode: CommandMode = CommandMode.DEFAULT): Runtime.RunScriptReturn

Runs script with given id in a given context.


suspend fun runScript(scriptId: String, executionContextId: Int? = null, objectGroup: String? = null, silent: Boolean? = null, includeCommandLineAPI: Boolean? = null, returnByValue: Boolean? = null, generatePreview: Boolean? = null, awaitPromise: Boolean? = null): Runtime.RunScriptReturn

Runs script with given id in a given context.

Parameters

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.