Launcher
Namespace: PuppeteerSharp
public class LauncherLauncher controls the creation of processes or the connection remote ones.
Inheritance: object
Constructors
Section titled “Constructors”Launcher(ILoggerFactory)
Section titled “Launcher(ILoggerFactory)”public Launcher(ILoggerFactory loggerFactory = null)Initializes a new instance of the Launcher class.
Parameters
| Name | Type | Description |
|---|---|---|
loggerFactory |
ILoggerFactory | Logger factory. |
Properties
Section titled “Properties”Process
Section titled “Process”public LauncherBase Process { get; }Gets the process, if any was created by this launcher.
Value: LauncherBase
Methods
Section titled “Methods”ConnectAsync(ConnectOptions)
Section titled “ConnectAsync(ConnectOptions)”public Task<IBrowser> ConnectAsync(ConnectOptions options)Attaches Puppeteer to an existing process instance. The browser will be closed when the Browser is disposed.
Parameters
| Name | Type | Description |
|---|---|---|
options |
ConnectOptions | Options for connecting. |
Returns: Task<IBrowser> — A connected browser.
LaunchAsync(LaunchOptions)
Section titled “LaunchAsync(LaunchOptions)”[SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope", Justification = "The caller is responsible for disposing the returned object.")]public Task<IBrowser> LaunchAsync(LaunchOptions options)The method launches a browser instance with given arguments. The browser will be closed when the Browser is disposed.
Parameters
| Name | Type | Description |
|---|---|---|
options |
LaunchOptions | Options for launching the browser. |
Returns: Task<IBrowser> — A connected browser.
See <a href=“https://www.howtogeek.com/202825/what%E2%80%99s-the-difference-between-chromium-and-chrome/">this article</a> for a description of the differences between Chromium and Chrome. <a href=“https://chromium.googlesource.com/chromium/src/+/lkcr/docs/chromium_browser_vs_google_chrome.md">This article</a> describes some differences for Linux users.
Made with love by Dario Kondratiuk