EvaluateParameter

@Serializable
data class EvaluateParameter(val expression: String, val objectGroup: String? = null, val includeCommandLineAPI: Boolean? = null, val silent: Boolean? = null, val contextId: Int? = null, val returnByValue: Boolean? = null, val generatePreview: Boolean? = null, val userGesture: Boolean? = null, val awaitPromise: Boolean? = null, val throwOnSideEffect: Boolean? = null, val timeout: Double? = null, val disableBreaks: Boolean? = null, val replMode: Boolean? = null, val allowUnsafeEvalBlockedByCSP: Boolean? = null, val uniqueContextId: String? = null, val serializationOptions: Runtime.SerializationOptions? = null)

Constructors

Link copied to clipboard
constructor(expression: String, objectGroup: String? = null, includeCommandLineAPI: Boolean? = null, silent: Boolean? = null, contextId: Int? = null, returnByValue: Boolean? = null, generatePreview: Boolean? = null, userGesture: Boolean? = null, awaitPromise: Boolean? = null, throwOnSideEffect: Boolean? = null, timeout: Double? = null, disableBreaks: Boolean? = null, replMode: Boolean? = null, allowUnsafeEvalBlockedByCSP: Boolean? = null, uniqueContextId: String? = null, serializationOptions: Runtime.SerializationOptions? = null)

Properties

Link copied to clipboard

The Content Security Policy (CSP) for the target might block 'unsafe-eval' which includes eval(), Function(), setTimeout() and setInterval() when called with non-callable arguments. This flag bypasses CSP for this evaluation and allows unsafe-eval. Defaults to true.

Link copied to clipboard
val awaitPromise: Boolean? = null

Whether execution should await for resulting value and return once awaited promise is resolved.

Link copied to clipboard
val contextId: Int? = null

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. This is mutually exclusive with uniqueContextId, which offers an alternative way to identify the execution context that is more reliable in a multi-process environment.

Link copied to clipboard
val disableBreaks: Boolean? = null

Disable breakpoints during execution.

Link copied to clipboard

Expression to evaluate.

Link copied to clipboard

Whether preview should be generated for the result.

Link copied to clipboard

Determines whether Command Line API should be available during the evaluation.

Link copied to clipboard
val objectGroup: String? = null

Symbolic group name that can be used to release multiple objects.

Link copied to clipboard
val replMode: Boolean? = null

Setting this flag to true enables let re-declaration and top-level await. Note that let variables can only be re-declared if they originate from replMode themselves.

Link copied to clipboard
val returnByValue: Boolean? = null

Whether the result is expected to be a JSON object that should be sent by value.

Link copied to clipboard

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

Link copied to clipboard
val silent: Boolean? = null

In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state.

Link copied to clipboard

Whether to throw an exception if side effect cannot be ruled out during evaluation. This implies disableBreaks below.

Link copied to clipboard
val timeout: Double? = null

Terminate execution after timing out (number of milliseconds).

Link copied to clipboard
val uniqueContextId: String? = null

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

Link copied to clipboard
val userGesture: Boolean? = null

Whether execution should be treated as initiated by user in the UI.