Пример #1
0
 /// <inheritdoc />
 public async Task <T> EvaluateAsync <T>(string pageFunction)
 => ScriptsHelper.ParseEvaluateResult <T>(await _channel.EvaluateExpressionAsync(
                                              script: pageFunction,
                                              isFunction: pageFunction.IsJavascriptFunction(),
                                              arg: EvaluateArgument.Undefined).ConfigureAwait(false));
Пример #2
0
 public async Task <JsonElement?> EvaluateAsync(string expression, object arg = null)
 => ScriptsHelper.ParseEvaluateResult <JsonElement?>(await _channel.EvaluateExpressionAsync(
                                                         script: expression,
                                                         arg: ScriptsHelper.SerializedArgument(arg)).ConfigureAwait(false));