MotusLauncher Class#
Public entry point for launching and connecting to browsers.
public static class MotusLauncher
Inheritance System.Object → MotusLauncher
Methods#
ConnectAsync(string, ConnectOptions, CancellationToken) Method#
Connects to a browser that is already running. The endpoint may be a CDP WebSocket URL, or the browser's HTTP debugging endpoint, from which the WebSocket URL is resolved.
public static System.Threading.Tasks.Task<Motus.Abstractions.IBrowser> ConnectAsync(string endpoint, Motus.Abstractions.ConnectOptions? options, System.Threading.CancellationToken ct=default(System.Threading.CancellationToken));
Parameters#
endpoint System.String
options ConnectOptions
ct System.Threading.CancellationToken
Returns#
System.Threading.Tasks.Task<IBrowser>
Remarks#
The returned browser is not owned: neither closing nor disposing it ends the browser process. By default the contexts and pages already open are adopted, so they can be driven straight away.
ConnectAsync(string, CancellationToken) Method#
Connects to an existing browser instance via its CDP WebSocket endpoint.
public static System.Threading.Tasks.Task<Motus.Abstractions.IBrowser> ConnectAsync(string wsEndpoint, System.Threading.CancellationToken ct=default(System.Threading.CancellationToken));
Parameters#
wsEndpoint System.String
ct System.Threading.CancellationToken
Returns#
System.Threading.Tasks.Task<IBrowser>
LaunchAsync(LaunchOptions, CancellationToken) Method#
Launches a new browser process and connects to it via CDP (Chromium) or WebDriver BiDi (Firefox).
public static System.Threading.Tasks.Task<Motus.Abstractions.IBrowser> LaunchAsync(Motus.Abstractions.LaunchOptions? options=null, System.Threading.CancellationToken ct=default(System.Threading.CancellationToken));
Parameters#
options LaunchOptions
ct System.Threading.CancellationToken