BrowserFetcher
Namespace: PuppeteerSharp
public sealed class BrowserFetcher : IBrowserFetcherSupports 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
Constructors
Section titled “Constructors”BrowserFetcher()
Section titled “BrowserFetcher()”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.
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 |
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 |
Properties
Section titled “Properties”BaseUrl
Section titled “BaseUrl”public string BaseUrl { get; set; }A download host to be used.
Value: string
Browser
Section titled “Browser”public SupportedBrowser Browser { get; set; }Gets the browser.
Value: SupportedBrowser
CacheDir
Section titled “CacheDir”public string CacheDir { get; set; }Determines the path to download browsers to.
Value: string
Platform
Section titled “Platform”public Platform Platform { get; set; }Gets the platform.
Value: Platform
WebProxy
Section titled “WebProxy”public IWebProxy WebProxy { get; set; }Proxy used by the HttpClient in DownloadAsync(), DownloadAsync(string) and CanDownloadAsync(string).
Value: IWebProxy
Methods
Section titled “Methods”CanDownloadAsync(string)
Section titled “CanDownloadAsync(string)”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.
DownloadAsync()
Section titled “DownloadAsync()”public Task<InstalledBrowser> DownloadAsync()Downloads the revision.
Returns: Task<InstalledBrowser> — Task which resolves to the completed download.
DownloadAsync(BrowserTag)
Section titled “DownloadAsync(BrowserTag)”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.
DownloadAsync(string)
Section titled “DownloadAsync(string)”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.
GetExecutablePath(string)
Section titled “GetExecutablePath(string)”public string GetExecutablePath(string buildId)Gets the executable path.
Parameters
| Name | Type | Description |
|---|---|---|
buildId |
string | Browser buildId. |
Returns: string — The executable path.
GetInstalledBrowsers()
Section titled “GetInstalledBrowsers()”public IEnumerable<InstalledBrowser> GetInstalledBrowsers()A list of all browsers available locally on disk.
Returns: IEnumerable<InstalledBrowser> — The available browsers.
Uninstall(string)
Section titled “Uninstall(string)”public void Uninstall(string buildId)Removes a downloaded browser.
Parameters
| Name | Type | Description |
|---|---|---|
buildId |
string | Browser to remove. |
Made with love by Dario Kondratiuk