Skip to main content
Module

x/puppeteer_plus/mod.ts>BrowserFetcher

Deno port of puppeteer base on latest TypeScript source.
Go to Latest
class BrowserFetcher
Re-export
import { BrowserFetcher } from "https://deno.land/x/puppeteer_plus@0.14.0/mod.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(projectRoot: string, options?: BrowserFetcherOptions)

Methods

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 | undefined>

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