mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
Add environment variable to skip download (#606)
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 #603
This commit is contained in:
parent
3365562b2b
commit
9d7929cd36
@ -7,6 +7,7 @@
|
||||
<!-- toc -->
|
||||
|
||||
- [Puppeteer](#puppeteer)
|
||||
* [Environment Variables](#environment-variables)
|
||||
* [class: Puppeteer](#class-puppeteer)
|
||||
+ [puppeteer.connect(options)](#puppeteerconnectoptions)
|
||||
+ [puppeteer.launch([options])](#puppeteerlaunchoptions)
|
||||
@ -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
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user