Table of Contents

Class SetViewportMetaOverrideCommandParameters

Namespace
WebDriverBiDi.Emulation
Assembly
WebDriverBiDi.dll

Provides parameters for the emulation.setViewportMetaOverride command.

public class SetViewportMetaOverrideCommandParameters : CommandParameters<SetViewportMetaOverrideCommandResult>
Inheritance
SetViewportMetaOverrideCommandParameters
Inherited Members

Constructors

SetViewportMetaOverrideCommandParameters()

Initializes a new instance of the SetViewportMetaOverrideCommandParameters class.

public SetViewportMetaOverrideCommandParameters()

Properties

Contexts

Gets the browsing contexts for which to set whether the <meta name=viewport> tag is overridden.

[JsonIgnore]
public List<string> Contexts { get; }

Property Value

List<string>

Remarks

The protocol requires this property, when present, to contain at least one entry. An empty list therefore means "not specified": the property is omitted from the JSON payload entirely, and an empty array is never sent. Add entries to the list to scope the command.

The two scopes are mutually exclusive: a command that names both browsing contexts and user contexts is rejected by the remote end with an invalid argument error. Scope the command one way or the other.

IsViewportMetaOverridden

Gets or sets a value indicating whether the <meta name=viewport> tag is overridden.

[JsonPropertyName("viewportMeta")]
public bool? IsViewportMetaOverridden { get; set; }

Property Value

bool?

Remarks

The protocol only supports enabling the override: the valid values are true to override the <meta name=viewport> tag, or null to clear the override. Sending false is not defined by the protocol, and the remote end is expected to reject it.

MethodName

Gets the method name of the command.

[JsonIgnore]
public override string MethodName { get; }

Property Value

string

ResetViewportMetaOverride

Gets a pre-initialized instance of SetViewportMetaOverrideCommandParameters with the IsViewportMetaOverridden property set to null to clear any existing viewport meta override. Returns a new instance on each access to allow for modification of the properties without affecting other uses. Functionally equivalent to using the parameterless constructor, but provided as a named property to make the intent of clearing the override more explicit in code that uses this property.

public static SetViewportMetaOverrideCommandParameters ResetViewportMetaOverride { get; }

Property Value

SetViewportMetaOverrideCommandParameters

UserContexts

Gets the user contexts for which to set whether the <meta name=viewport> tag is overridden.

[JsonIgnore]
public List<string> UserContexts { get; }

Property Value

List<string>

Remarks

The protocol requires this property, when present, to contain at least one entry. An empty list therefore means "not specified": the property is omitted from the JSON payload entirely, and an empty array is never sent. Add entries to the list to scope the command.

The two scopes are mutually exclusive: a command that names both browsing contexts and user contexts is rejected by the remote end with an invalid argument error. Scope the command one way or the other.