Exemplo n.º 1
0
 internal async Task <T> EvalOnSelectorAllAsync <T>(bool isPageCall, string selector, string script, object args)
 => ScriptsHelper.ParseEvaluateResult <T>(await _channel.EvalOnSelectorAllAsync(
                                              selector: selector,
                                              script: script,
                                              isFunction: script.IsJavascriptFunction(),
                                              arg: ScriptsHelper.SerializedArgument(args),
                                              isPage: isPageCall).ConfigureAwait(false));
Exemplo n.º 2
0
 internal Task DispatchEventAsync(bool isPageCall, string selector, string type, object eventInit, float?timeout)
 => _channel.DispatchEventAsync(
     selector,
     type,
     eventInit == null ? EvaluateArgument.Undefined : ScriptsHelper.SerializedArgument(eventInit),
     timeout,
     isPageCall);
Exemplo n.º 3
0
 internal async Task <IJSHandle> WaitForFunctionAsync(bool isPageCall, string expression, object args, float?pollingInterval, float?timeout)
 => (await _channel.WaitForFunctionAsync(
         expression: expression,
         isFunction: expression.IsJavascriptFunction(),
         arg: ScriptsHelper.SerializedArgument(args),
         isPage: isPageCall,
         timeout: timeout,
         polling: pollingInterval).ConfigureAwait(false)).Object;
Exemplo n.º 4
0
 /// <inheritdoc />
 public Task DispatchEventAsync(string type, object eventInit)
 => _channel.DispatchEventAsync(
     type,
     eventInit == null ? EvaluateArgument.Undefined : ScriptsHelper.SerializedArgument(eventInit));
Exemplo n.º 5
0
 /// <inheritdoc />
 public async Task <JsonElement?> EvaluateAsync(string expression, object arg)
 => ScriptsHelper.ParseEvaluateResult <JsonElement?>(await _channel.EvaluateExpressionAsync(
                                                         script: expression,
                                                         isFunction: expression.IsJavascriptFunction(),
                                                         arg: ScriptsHelper.SerializedArgument(arg)).ConfigureAwait(false));