Skip to content

BrowserFetcher

Namespace: PuppeteerSharp

public sealed class BrowserFetcher : IBrowserFetcher

Supports all classes in the .NET class hierarchy and provides low-level services to derived classes. This is the ultimate base class of all .NET classes; it is the root of the type hierarchy.

Inheritance: object

Implements: IBrowserFetcher

View source

public BrowserFetcher()

Supports all classes in the .NET class hierarchy and provides low-level services to derived classes. This is the ultimate base class of all .NET classes; it is the root of the type hierarchy.

View source

BrowserFetcher(BrowserFetcherOptions, ILoggerFactory)

Section titled “BrowserFetcher(BrowserFetcherOptions, ILoggerFactory)”
public BrowserFetcher(BrowserFetcherOptions options, ILoggerFactory loggerFactory = null)

Supports all classes in the .NET class hierarchy and provides low-level services to derived classes. This is the ultimate base class of all .NET classes; it is the root of the type hierarchy.

Parameters

Name Type Description
options BrowserFetcherOptions
loggerFactory ILoggerFactory

View source

BrowserFetcher(SupportedBrowser, ILoggerFactory)

Section titled “BrowserFetcher(SupportedBrowser, ILoggerFactory)”
public BrowserFetcher(SupportedBrowser browser, ILoggerFactory loggerFactory = null)

Supports all classes in the .NET class hierarchy and provides low-level services to derived classes. This is the ultimate base class of all .NET classes; it is the root of the type hierarchy.

Parameters

Name Type Description
browser SupportedBrowser
loggerFactory ILoggerFactory

View source

public string BaseUrl { get; set; }

A download host to be used.

Value: string

View source

public SupportedBrowser Browser { get; set; }

Gets the browser.

Value: SupportedBrowser

View source

public string CacheDir { get; set; }

Determines the path to download browsers to.

Value: string

View source

public Platform Platform { get; set; }

Gets the platform.

Value: Platform

View source

public IWebProxy WebProxy { get; set; }

Proxy used by the HttpClient in DownloadAsync(), DownloadAsync(string) and CanDownloadAsync(string).

Value: IWebProxy

View source

public Task<bool> CanDownloadAsync(string revision)

The method initiates a HEAD request to check if the revision is available.

Parameters

Name Type Description
revision string

Returns: Task<bool> — Whether the version is available or not.

View source

public Task<InstalledBrowser> DownloadAsync()

Downloads the revision.

Returns: Task<InstalledBrowser> — Task which resolves to the completed download.

View source

public Task<InstalledBrowser> DownloadAsync(BrowserTag tag)

Downloads the revision.

Parameters

Name Type Description
tag BrowserTag Browser tag.

Returns: Task<InstalledBrowser> — Task which resolves to the completed download.

View source

public Task<InstalledBrowser> DownloadAsync(string buildId)

Downloads the revision.

Parameters

Name Type Description
buildId string

Returns: Task<InstalledBrowser> — Task which resolves to the completed download.

View source

public string GetExecutablePath(string buildId)

Gets the executable path.

Parameters

Name Type Description
buildId string Browser buildId.

Returns: string — The executable path.

View source

public IEnumerable<InstalledBrowser> GetInstalledBrowsers()

A list of all browsers available locally on disk.

Returns: IEnumerable<InstalledBrowser> — The available browsers.

View source

public void Uninstall(string buildId)

Removes a downloaded browser.

Parameters

Name Type Description
buildId string Browser to remove.

View source

Made with love by Dario Kondratiuk