Table of Contents

Class CallFunctionCommandParameters

Namespace
WebDriverBiDi.Script
Assembly
WebDriverBiDi.dll

Provides parameters for the script.callFunction command.

public class CallFunctionCommandParameters : CommandParameters<EvaluateResult>
Inheritance
CallFunctionCommandParameters
Inherited Members

Constructors

CallFunctionCommandParameters(string, Target, bool)

Initializes a new instance of the CallFunctionCommandParameters class.

public CallFunctionCommandParameters(string functionDeclaration, Target scriptTarget, bool awaitPromise)

Parameters

functionDeclaration string

The function declaration.

scriptTarget Target

The script target in which to call the function.

awaitPromise bool

true to await the script evaluation as a Promise; otherwise, false.

Properties

Arguments

Gets the list of arguments to pass to the function.

[JsonIgnore]
public List<LocalValue> Arguments { get; }

Property Value

List<LocalValue>

Remarks

This property is optional in the protocol, and omitting it has the same meaning as sending an empty array. An empty list therefore means "not specified": the property is omitted from the JSON payload entirely. Add entries to the list to pass arguments to the function.

AwaitPromise

Gets or sets a value indicating whether a Promise returned by the function is awaited. The function is always called to completion; when this is true and the result is a Promise, its settled value is returned in place of the Promise itself.

[JsonPropertyName("awaitPromise")]
public bool AwaitPromise { get; set; }

Property Value

bool

FunctionDeclaration

Gets or sets the function declaration.

[JsonPropertyName("functionDeclaration")]
public string FunctionDeclaration { get; set; }

Property Value

string

MethodName

Gets the method name of the command.

[JsonIgnore]
public override string MethodName { get; }

Property Value

string

ResultOwnership

Gets or sets the ownership model to use for objects in the function call.

[JsonPropertyName("resultOwnership")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public ResultOwnership? ResultOwnership { get; set; }

Property Value

ResultOwnership?

ScriptTarget

Gets or sets the script target against which to call the function.

[JsonPropertyName("target")]
public Target ScriptTarget { get; set; }

Property Value

Target

SerializationOptions

Gets or sets the serialization options for serializing results.

[JsonPropertyName("serializationOptions")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public SerializationOptions? SerializationOptions { get; set; }

Property Value

SerializationOptions

ThisObject

Gets or sets the item to use as the 'this' object when the function is called.

[JsonPropertyName("this")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public LocalValue? ThisObject { get; set; }

Property Value

LocalValue

UserActivation

Gets or sets a value indicating whether the call is treated as user-activated, as though the user had interacted with the page, which APIs gated on a user gesture require. When omitted, is treated as if false.

[JsonPropertyName("userActivation")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public bool? UserActivation { get; set; }

Property Value

bool?