From 506103556b3dc48ddadb92d7dcfecdd37f3c139b Mon Sep 17 00:00:00 2001 From: Glenn Vandamme Date: Thu, 29 Mar 2018 19:46:00 +0200 Subject: [PATCH] feat(install): introduce PUPPETEER_CHROMIUM_REVISION (#2246) This patch introduces PUPPETEER_CHROMIUM_REVISION environment variable to specify chromium revision to be downloaded during install step. --- docs/api.md | 1 + install.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/api.md b/docs/api.md index 609f22f59b0..9b767d28047 100644 --- a/docs/api.md +++ b/docs/api.md @@ -270,6 +270,7 @@ Puppeteer looks for certain [environment variables](https://en.wikipedia.org/wik - `HTTP_PROXY`, `HTTPS_PROXY`, `NO_PROXY` - defines HTTP proxy settings that are used to download and run Chromium. - `PUPPETEER_SKIP_CHROMIUM_DOWNLOAD` - do not download bundled Chromium during installation step. - `PUPPETEER_DOWNLOAD_HOST` - overwrite host part of URL that is used to download Chromium +- `PUPPETEER_CHROMIUM_REVISION` - specify a certain version of chrome you'd like puppeteer to use during the installation step. ### class: Puppeteer diff --git a/install.js b/install.js index 49541079987..44f753103db 100644 --- a/install.js +++ b/install.js @@ -30,7 +30,7 @@ const downloadHost = process.env.PUPPETEER_DOWNLOAD_HOST || process.env.npm_conf const puppeteer = require('./index'); const browserFetcher = puppeteer.createBrowserFetcher({ host: downloadHost }); -const revision = require('./package.json').puppeteer.chromium_revision; +const revision = process.env.PUPPETEER_CHROMIUM_REVISION || require('./package.json').puppeteer.chromium_revision; const revisionInfo = browserFetcher.revisionInfo(revision); // Do nothing if the revision is already downloaded.