Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/puppeteer/src/deno/BrowserFetcher.ts>BrowserFetcher

A port of puppeteer running on Deno
Latest
class BrowserFetcher
import { BrowserFetcher } from "https://deno.land/x/puppeteer@16.2.0/src/deno/BrowserFetcher.ts";

BrowserFetcher can download and manage different versions of Chromium and Firefox.

Examples

An example of using BrowserFetcher to download a specific version of Chromium and running Puppeteer against it:

const browserFetcher = puppeteer.createBrowserFetcher();
const revisionInfo = await browserFetcher.download('533271');
const browser = await puppeteer.launch({executablePath: revisionInfo.executablePath})

NOTE BrowserFetcher is not designed to work concurrently with other instances of BrowserFetcher that share the same downloads directory.

Constructors

new
BrowserFetcher(options?: BrowserFetcherOptions)

Properties

private
_downloadHost: string
private
_downloadsFolder: string
private
_platform: Platform
private
_product: Product

Methods

private
setPlatform(platformFromOptions?: Platform): void
_getFolderPath(revision: string): string
canDownload(revision: string): Promise<boolean>

Initiates a HEAD request to check if the revision is available.

download(revision: string, progressCallback?: (x: number, y: number) => void): Promise<BrowserFetcherRevisionInfo>

Initiates a GET request to download the revision from the host.

host(): string
localRevisions(): Promise<string[]>
platform(): Platform
product(): Product
remove(revision: string): Promise<void>
revisionInfo(revision: string): BrowserFetcherRevisionInfo