From 417ac95826959c28df91975360783a85ca400a37 Mon Sep 17 00:00:00 2001 From: christian-bromann Date: Thu, 16 Jul 2020 13:40:50 +0200 Subject: [PATCH 1/3] docs: add env variable to the error message --- src/node/Launcher.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node/Launcher.ts b/src/node/Launcher.ts index eb34538864319..f1c4cf469b1d9 100644 --- a/src/node/Launcher.ts +++ b/src/node/Launcher.ts @@ -771,7 +771,7 @@ function resolveExecutablePath( } const revisionInfo = browserFetcher.revisionInfo(launcher._preferredRevision); const missingText = !revisionInfo.local - ? `Could not find browser revision ${launcher._preferredRevision}. Run "npm install" or "yarn install" to download a browser binary.` + ? `Could not find browser revision ${launcher._preferredRevision}. Run "PUPPETEER_PRODUCT=firefox npm install" or "PUPPETEER_PRODUCT=firefox yarn install" to download a support version of the Firefox browser binary.` : null; return { executablePath: revisionInfo.executablePath, missingText }; } From dcc5765aad25da1f5d24b254eea878535e96c88e Mon Sep 17 00:00:00 2001 From: christian-bromann Date: Thu, 16 Jul 2020 13:43:38 +0200 Subject: [PATCH 2/3] docs: enhance puppeteer.product docs --- docs/api.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/api.md b/docs/api.md index bc471a0b958d6..ec69ef1a4e8a2 100644 --- a/docs/api.md +++ b/docs/api.md @@ -593,7 +593,7 @@ const browser = await puppeteer.launch({ #### puppeteer.product - returns: <[string]> returns the name of the browser that is under automation (`"chrome"` or `"firefox"`) -The product is set by the `PUPPETEER_PRODUCT` environment variable or the `product` option in [puppeteer.launch([options])](#puppeteerlaunchoptions) and defaults to `chrome`. Firefox support is experimental. +The product is set by the `PUPPETEER_PRODUCT` environment variable or the `product` option in [puppeteer.launch([options])](#puppeteerlaunchoptions) and defaults to `chrome`. Firefox support is experimental and requires to install Puppeteer via `PUPPETEER_PRODUCT=firefox npm i puppeteer`. ### class: BrowserFetcher From 7cb213a97757039a0766216ce6df7f121641fd66 Mon Sep 17 00:00:00 2001 From: Christian Bromann Date: Thu, 16 Jul 2020 13:57:54 +0200 Subject: [PATCH 3/3] Update src/node/Launcher.ts Co-authored-by: Mathias Bynens --- src/node/Launcher.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node/Launcher.ts b/src/node/Launcher.ts index f1c4cf469b1d9..1e0812e07773b 100644 --- a/src/node/Launcher.ts +++ b/src/node/Launcher.ts @@ -771,7 +771,7 @@ function resolveExecutablePath( } const revisionInfo = browserFetcher.revisionInfo(launcher._preferredRevision); const missingText = !revisionInfo.local - ? `Could not find browser revision ${launcher._preferredRevision}. Run "PUPPETEER_PRODUCT=firefox npm install" or "PUPPETEER_PRODUCT=firefox yarn install" to download a support version of the Firefox browser binary.` + ? `Could not find browser revision ${launcher._preferredRevision}. Run "PUPPETEER_PRODUCT=firefox npm install" or "PUPPETEER_PRODUCT=firefox yarn install" to download a supported Firefox browser binary.` : null; return { executablePath: revisionInfo.executablePath, missingText }; }