RuntimeClientEvaluateAsync Method |
Version 111.2.70
Evaluates expression on global object.
Namespace:
CefSharp.DevTools.Runtime
Assembly:
CefSharp (in CefSharp.dll) Version: 111.2.70.0 (111.2.70.0)
Syntax public Task<EvaluateResponse> EvaluateAsync(
string expression,
string objectGroup = null,
bool? includeCommandLineAPI = null,
bool? silent = null,
int? contextId = null,
bool? returnByValue = null,
bool? generatePreview = null,
bool? userGesture = null,
bool? awaitPromise = null,
bool? throwOnSideEffect = null,
double? timeout = null,
bool? disableBreaks = null,
bool? replMode = null,
bool? allowUnsafeEvalBlockedByCSP = null,
string uniqueContextId = null,
bool? generateWebDriverValue = null
)
public:
Task<EvaluateResponse^>^ EvaluateAsync(
String^ expression,
String^ objectGroup = nullptr,
Nullable<bool> includeCommandLineAPI = nullptr,
Nullable<bool> silent = nullptr,
Nullable<int> contextId = nullptr,
Nullable<bool> returnByValue = nullptr,
Nullable<bool> generatePreview = nullptr,
Nullable<bool> userGesture = nullptr,
Nullable<bool> awaitPromise = nullptr,
Nullable<bool> throwOnSideEffect = nullptr,
Nullable<double> timeout = nullptr,
Nullable<bool> disableBreaks = nullptr,
Nullable<bool> replMode = nullptr,
Nullable<bool> allowUnsafeEvalBlockedByCSP = nullptr,
String^ uniqueContextId = nullptr,
Nullable<bool> generateWebDriverValue = nullptr
)
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.This is mutually exclusive with `uniqueContextId`, which offers analternative way to identify the execution context that is more reliablein a multi-process environment. - 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: SystemNullableDouble
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. - uniqueContextId (Optional)
- Type: SystemString
An alternative way to specify the execution context to evaluate in.Compared to contextId that may be reused across processes, this is guaranteed to besystem-unique, so it can be used to prevent accidental evaluation of the expressionin context different than intended (e.g. as a result of navigation across processboundaries).This is mutually exclusive with `contextId`. - generateWebDriverValue (Optional)
- Type: SystemNullableBoolean
Whether the result should be serialized according to https://w3c.github.io/webdriver-bidi.
Return Value
Type:
TaskEvaluateResponsereturns System.Threading.Tasks.Task<EvaluateResponse>
See Also