Click or drag to resize

RuntimeClientEvaluateAsync Method

Version 87.1.132
Evaluates expression on global object.

Namespace:  CefSharp.DevTools.Runtime
Assembly:  CefSharp (in CefSharp.dll) Version: 87.1.132.0 (87.1.132.0)
Syntax
public Task<EvaluateResponse> EvaluateAsync(
	string expression,
	string objectGroup = null,
	Nullable<bool> includeCommandLineAPI = null,
	Nullable<bool> silent = null,
	Nullable<int> contextId = null,
	Nullable<bool> returnByValue = null,
	Nullable<bool> generatePreview = null,
	Nullable<bool> userGesture = null,
	Nullable<bool> awaitPromise = null,
	Nullable<bool> throwOnSideEffect = null,
	Nullable<long> timeout = null,
	Nullable<bool> disableBreaks = null,
	Nullable<bool> replMode = null,
	Nullable<bool> allowUnsafeEvalBlockedByCSP = null
)

Parameters

expression
Type: SystemString
Expression to evaluate.
objectGroup (Optional)
Type: SystemString
Symbolic group name that can be used to release multiple objects.
includeCommandLineAPI (Optional)
Type: SystemNullableBoolean
Determines whether Command Line API should be available during the evaluation.
silent (Optional)
Type: SystemNullableBoolean
In silent mode exceptions thrown during evaluation are not reported and do not pauseexecution. Overrides `setPauseOnException` state.
contextId (Optional)
Type: SystemNullableInt32
Specifies in which execution context to perform evaluation. If the parameter is omitted theevaluation will be performed in the context of the inspected page.
returnByValue (Optional)
Type: SystemNullableBoolean
Whether the result is expected to be a JSON object that should be sent by value.
generatePreview (Optional)
Type: SystemNullableBoolean
Whether preview should be generated for the result.
userGesture (Optional)
Type: SystemNullableBoolean
Whether execution should be treated as initiated by user in the UI.
awaitPromise (Optional)
Type: SystemNullableBoolean
Whether execution should `await` for resulting value and return once awaited promise isresolved.
throwOnSideEffect (Optional)
Type: SystemNullableBoolean
Whether to throw an exception if side effect cannot be ruled out during evaluation.This implies `disableBreaks` below.
timeout (Optional)
Type: SystemNullableInt64
Terminate execution after timing out (number of milliseconds).
disableBreaks (Optional)
Type: SystemNullableBoolean
Disable breakpoints during execution.
replMode (Optional)
Type: SystemNullableBoolean
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.
allowUnsafeEvalBlockedByCSP (Optional)
Type: SystemNullableBoolean
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 thisevaluation and allows unsafe-eval. Defaults to true.

Return Value

Type: TaskEvaluateResponse
returns System.Threading.Tasks.Task<EvaluateResponse>
See Also