Table of Contents

Class SessionModuleExtensions

Namespace
WebDriverBiDi.Session
Assembly
WebDriverBiDi.Extensions.dll

Provides extension methods for the Session module.

public static class SessionModuleExtensions
Inheritance
SessionModuleExtensions
Inherited Members

Methods

SubscribeAsync(SessionModule, IEnumerable<string>, IEnumerable<string>?, TimeSpan?, CancellationToken)

Subscribes to events, in every browsing context or in the given ones.

public static Task<string> SubscribeAsync(this SessionModule module, IEnumerable<string> eventNames, IEnumerable<string>? browsingContextIds = null, TimeSpan? timeoutOverride = null, CancellationToken cancellationToken = default)

Parameters

module SessionModule

The SessionModule to extend.

eventNames IEnumerable<string>

The names of the events, such as "log.entryAdded".

browsingContextIds IEnumerable<string>

The browsing contexts in which to subscribe, or null for all.

timeoutOverride TimeSpan?

The timeout override to use for the command. If omitted, the value of DefaultCommandTimeout is used.

cancellationToken CancellationToken

A token that cancels waiting for the command's response.

Returns

Task<string>

The ID of the subscription, for UnsubscribeAsync(SessionModule, string, TimeSpan?, CancellationToken).

UnsubscribeAsync(SessionModule, string, TimeSpan?, CancellationToken)

Removes a subscription.

public static Task UnsubscribeAsync(this SessionModule module, string subscriptionId, TimeSpan? timeoutOverride = null, CancellationToken cancellationToken = default)

Parameters

module SessionModule

The SessionModule to extend.

subscriptionId string

The ID of the subscription.

timeoutOverride TimeSpan?

The timeout override to use for the command. If omitted, the value of DefaultCommandTimeout is used.

cancellationToken CancellationToken

A token that cancels waiting for the command's response.

Returns

Task

A task representing the asynchronous operation.