Skip to content

Commit

Permalink
Add environment variable to skip download (puppeteer#606)
Browse files Browse the repository at this point in the history
This patch:
- starts skipping chromium download if `PUPPETEER_SKIP_CHROMIUM_DOWNLOAD` env variable is set
- adds description of support env variables to the `docs/api.md`.

References puppeteer#603
  • Loading branch information
aslushnikov authored Aug 31, 2017
1 parent 3365562 commit 9d7929c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
7 changes: 7 additions & 0 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<!-- toc -->

- [Puppeteer](#puppeteer)
* [Environment Variables](#environment-variables)
* [class: Puppeteer](#class-puppeteer)
+ [puppeteer.connect(options)](#puppeteerconnectoptions)
+ [puppeteer.launch([options])](#puppeteerlaunchoptions)
Expand Down Expand Up @@ -137,6 +138,12 @@

Puppeteer is a Node library which provides a high-level API to control Chromium over the DevTools Protocol.

### Environment Variables

Puppeteer looks for certain environment variables to aid its operations:

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

### class: Puppeteer

Expand Down
5 changes: 5 additions & 0 deletions install.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
* limitations under the License.
*/

if (process.env.PUPPETEER_SKIP_CHROMIUM_DOWNLOAD) {
console.log('**INFO** Skipping Chromium download. "PUPPETEER_SKIP_CHROMIUM_DOWNLOAD" environment variable was found.');
return;
}

const Downloader = require('./utils/ChromiumDownloader');
const platform = Downloader.currentPlatform();
const revision = require('./package').puppeteer.chromium_revision;
Expand Down

0 comments on commit 9d7929c

Please sign in to comment.