Skip to content

LauncherBase

Namespace: PuppeteerSharp

public abstract class LauncherBase : IDisposable

Represents a Base process and any associated temporary user data directory that have created by Puppeteer and therefore must be cleaned up when no longer needed.

Inheritance: object

Implements: IDisposable

Derived: ChromeLauncher, FirefoxLauncher

View source

protected LauncherBase(string executable, LaunchOptions options)

Initializes a new instance of the LauncherBase class.

Parameters

Name Type Description
executable string Full path of executable.
options LaunchOptions Options for launching Base.

View source

public string EndPoint { get; }

Gets Base endpoint.

Value: string

View source

public bool HasExited { get; }

Indicates whether Base process has exited.

Value: bool

View source

public bool IsExiting { get; }

Indicates whether Base process is exiting.

Value: bool

View source

public Process Process { get; }

Gets Base process details.

Value: Process

View source

public void Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

View source

protected virtual void Dispose(bool disposing)

Disposes Base process and any temporary user directory.

Parameters

Name Type Description
disposing bool Indicates whether disposal was initiated by Dispose() operation.

View source

public Task EnsureExitAsync(TimeSpan? timeout)

Asynchronously waits for graceful Base process exit within a given timeout period. Kills the Base process if it has not exited within this period.

Parameters

Name Type Description
timeout TimeSpan? The maximum waiting time for a graceful process exit.

Returns: Task — Task which resolves when the process is exited or killed.

View source

protected ~LauncherBase()

Finalizes an instance of the LauncherBase class.

View source

public Task KillAsync()

Asynchronously kills Base process.

Returns: Task — Task which resolves when the process is killed.

View source

SetEnvVariables(IDictionary<string, string>, IDictionary<string, string>, IDictionary)

Section titled “SetEnvVariables(IDictionary<string, string>, IDictionary<string, string>, IDictionary)”
protected static void SetEnvVariables(IDictionary<string, string> environment, IDictionary<string, string> customEnv, IDictionary realEnv)

Set Env Variables.

Parameters

Name Type Description
environment IDictionary<string, string> The environment.
customEnv IDictionary<string, string> The customEnv.
realEnv IDictionary The realEnv.

View source

public Task StartAsync()

Asynchronously starts Base process.

Returns: Task — Task which resolves when after start process begins.

View source

public Task<bool> WaitForExitAsync(TimeSpan? timeout)

Waits for Base process exit within a given timeout.

Parameters

Name Type Description
timeout TimeSpan? The maximum wait period.

Returns: Task<bool> — true if Base process has exited within the given <code class=“paramref”>timeout</code>, or false otherwise.

View source

Made with love by Dario Kondratiuk