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.
This commit is contained in:
Glenn Vandamme 2018-03-29 19:46:00 +02:00 committed by Andrey Lushnikov
parent ebe17371b0
commit 506103556b
2 changed files with 2 additions and 1 deletions

View File

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

View File

@ -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.