Table of Contents

Interface IBrowserFetcher

Namespace
PuppeteerSharp
Assembly
PuppeteerSharp.dll

BrowserFetcher can download and manage different versions of Chromium.

public interface IBrowserFetcher : IDisposable

Examples

Example on how to use BrowserFetcher to download a specific version of Chromium and run Puppeteer against it:

var browserFetcher = Puppeteer.CreateBrowserFetcher();
var revisionInfo = await browserFetcher.DownloadAsync(BrowserData.Chrome.DefaultBuildId);
var browser = await await Puppeteer.LaunchAsync(new LaunchOptions { ExecutablePath = revisionInfo.ExecutablePath});

Properties

BaseUrl

A download host to be used.

string BaseUrl { get; set; }

Property Value

string

Browser

Gets the browser.

SupportedBrowser Browser { get; set; }

Property Value

SupportedBrowser

CacheDir

Determines the path to download browsers to.

string CacheDir { get; set; }

Property Value

string

Platform

Gets the platform.

Platform Platform { get; set; }

Property Value

Platform

WebProxy

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

IWebProxy WebProxy { get; set; }

Property Value

IWebProxy

Methods

CanDownloadAsync(string)

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

Task<bool> CanDownloadAsync(string buildId)

Parameters

buildId string

A build to check availability.

Returns

Task<bool>

Whether the version is available or not.

DownloadAsync()

Downloads the revision.

Task<InstalledBrowser> DownloadAsync()

Returns

Task<InstalledBrowser>

Task which resolves to the completed download.

DownloadAsync(BrowserTag)

Downloads the revision.

Task<InstalledBrowser> DownloadAsync(BrowserTag tag)

Parameters

tag BrowserTag

Browser tag.

Returns

Task<InstalledBrowser>

Task which resolves to the completed download.

DownloadAsync(string)

Downloads the revision.

Task<InstalledBrowser> DownloadAsync(string revision)

Parameters

revision string

Revision.

Returns

Task<InstalledBrowser>

Task which resolves to the completed download.

GetExecutablePath(string)

Gets the executable path.

string GetExecutablePath(string buildId)

Parameters

buildId string

Browser buildId.

Returns

string

The executable path.

GetInstalledBrowsers()

A list of all browsers available locally on disk.

IEnumerable<InstalledBrowser> GetInstalledBrowsers()

Returns

IEnumerable<InstalledBrowser>

The available browsers.

Uninstall(string)

Removes a downloaded browser.

void Uninstall(string buildId)

Parameters

buildId string

Browser to remove.

Events

DownloadProgressChanged

Occurs when download progress in DownloadAsync()/DownloadAsync(string) changes.

event DownloadProgressChangedEventHandler DownloadProgressChanged

Event Type

DownloadProgressChangedEventHandler