diff --git a/docs/api/puppeteer.configuration.md b/docs/api/puppeteer.configuration.md
index 47f13912..398f1f50 100644
--- a/docs/api/puppeteer.configuration.md
+++ b/docs/api/puppeteer.configuration.md
@@ -21,10 +21,10 @@ export interface Configuration
| browserRevision | optional
| string |
Specifies a certain version of the browser you'd like Puppeteer to use.
Can be overridden by PUPPETEER_BROWSER_REVISION
.
See [puppeteer.launch](./puppeteer.puppeteernode.launch.md) on how executable path is inferred.
| A compatible-revision of the browser. | | cacheDirectory |optional
| string | Defines the directory to be used by Puppeteer for caching.
Can be overridden by PUPPETEER_CACHE_DIR
.
path.join(os.homedir(), '.cache', 'puppeteer')
|
| defaultProduct | optional
| [Product](./puppeteer.product.md) | Specifies which browser you'd like Puppeteer to use.
Can be overridden by PUPPETEER_PRODUCT
.
chrome
|
-| downloadHost | optional
| string | Specifies the URL prefix that is used to download the browser.
Can be overridden by PUPPETEER_DOWNLOAD_HOST
.
optional
| string | Specifies the URL prefix that is used to download the browser.
Can be overridden by PUPPETEER_DOWNLOAD_BASE_URL
.
optional
| string | Specifies the path for the downloads folder.
Can be overridden by PUPPETEER_DOWNLOAD_PATH
.
<cache>/<product>
where <cache>
is Puppeteer's cache directory and <product>
is the name of the browser. |
| executablePath | optional
| string | Specifies an executable path to be used in [puppeteer.launch](./puppeteer.puppeteernode.launch.md).
Can be overridden by PUPPETEER_EXECUTABLE_PATH
.
optional
| [ExperimentsConfiguration](./puppeteer.experimentsconfiguration.md) | Defines experimental options for Puppeteer. | |
-| logLevel | optional
| 'silent' \| 'error' \| 'warn' | Tells Puppeteer to log at the given level.
At the moment, any option silences logging.
|undefined
|
+| logLevel | optional
| 'silent' \| 'error' \| 'warn' | Tells Puppeteer to log at the given level. | warn
|
| skipDownload | optional
| boolean | Tells Puppeteer to not download during installation.
Can be overridden by PUPPETEER_SKIP_DOWNLOAD
.
optional
| string | Defines the directory to be used by Puppeteer for creating temporary files.
Can be overridden by PUPPETEER_TMP_DIR
.
os.tmpdir()
|
diff --git a/docs/browsers-api/browsers.installoptions.md b/docs/browsers-api/browsers.installoptions.md
index ab0731df..a013e10a 100644
--- a/docs/browsers-api/browsers.installoptions.md
+++ b/docs/browsers-api/browsers.installoptions.md
@@ -12,12 +12,12 @@ export interface InstallOptions
## Properties
-| Property | Modifiers | Type | Description | Default |
-| ------------------------ | --------------------- | -------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| baseUrl | optional
| string | Determines the host that will be used for downloading. | Either
- https://storage.googleapis.com/chromium-browser-snapshots or - https://archive.mozilla.org/pub/firefox/nightly/latest-mozilla-central
| -| browser | | [Browser](./browsers.browser.md) | Determines which browser to install. | | -| buildId | | string | Determines which buildId to dowloand. BuildId should uniquely identify binaries and they are used for caching. | | -| cacheDir | | string | Determines the path to download browsers to. | | -| downloadProgressCallback |optional
| (downloadedBytes: number, totalBytes: number) => void | Provides information about the progress of the download. | |
-| platform | optional
| [BrowserPlatform](./browsers.browserplatform.md) | Determines which platform the browser will be suited for. | **Auto-detected.** |
-| unpack | optional
| boolean | Whether to unpack and install browser archives. | true
|
+| Property | Modifiers | Type | Description | Default |
+| ------------------------ | --------------------- | -------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| baseUrl | optional
| string | Determines the host that will be used for downloading. | Either
- https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing or - https://archive.mozilla.org/pub/firefox/nightly/latest-mozilla-central
| +| browser | | [Browser](./browsers.browser.md) | Determines which browser to install. | | +| buildId | | string | Determines which buildId to dowloand. BuildId should uniquely identify binaries and they are used for caching. | | +| cacheDir | | string | Determines the path to download browsers to. | | +| downloadProgressCallback |optional
| (downloadedBytes: number, totalBytes: number) => void | Provides information about the progress of the download. | |
+| platform | optional
| [BrowserPlatform](./browsers.browserplatform.md) | Determines which platform the browser will be suited for. | **Auto-detected.** |
+| unpack | optional
| boolean | Whether to unpack and install browser archives. | true
|
diff --git a/packages/browsers/src/install.ts b/packages/browsers/src/install.ts
index 054e0484..6e9b5bee 100644
--- a/packages/browsers/src/install.ts
+++ b/packages/browsers/src/install.ts
@@ -84,7 +84,7 @@ export interface InstallOptions {
*
* @defaultValue Either
*
- * - https://storage.googleapis.com/chromium-browser-snapshots or
+ * - https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing or
* - https://archive.mozilla.org/pub/firefox/nightly/latest-mozilla-central
*
*/
diff --git a/packages/puppeteer-core/src/common/Configuration.ts b/packages/puppeteer-core/src/common/Configuration.ts
index 6db94c34..80e866eb 100644
--- a/packages/puppeteer-core/src/common/Configuration.ts
+++ b/packages/puppeteer-core/src/common/Configuration.ts
@@ -56,16 +56,16 @@ export interface Configuration {
/**
* Specifies the URL prefix that is used to download the browser.
*
- * Can be overridden by `PUPPETEER_DOWNLOAD_HOST`.
+ * Can be overridden by `PUPPETEER_DOWNLOAD_BASE_URL`.
*
* @remarks
* This must include the protocol and may even need a path prefix.
*
- * @defaultValue Either https://storage.googleapis.com or
+ * @defaultValue Either https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing or
* https://archive.mozilla.org/pub/firefox/nightly/latest-mozilla-central,
* depending on the product.
*/
- downloadHost?: string;
+ downloadBaseUrl?: string;
/**
* Specifies the path for the downloads folder.
*
@@ -109,9 +109,7 @@ export interface Configuration {
/**
* Tells Puppeteer to log at the given level.
*
- * At the moment, any option silences logging.
- *
- * @defaultValue `undefined`
+ * @defaultValue `warn`
*/
logLevel?: 'silent' | 'error' | 'warn';
/**
diff --git a/packages/puppeteer-core/src/node/ChromeLauncher.ts b/packages/puppeteer-core/src/node/ChromeLauncher.ts
index 9594ed33..7301e2df 100644
--- a/packages/puppeteer-core/src/node/ChromeLauncher.ts
+++ b/packages/puppeteer-core/src/node/ChromeLauncher.ts
@@ -48,8 +48,7 @@ export class ChromeLauncher extends ProductLauncher {
const headless = options.headless ?? true;
if (
headless === true &&
- (!this.puppeteer.configuration.logLevel ||
- this.puppeteer.configuration.logLevel === 'warn') &&
+ this.puppeteer.configuration.logLevel === 'warn' &&
!Boolean(process.env['PUPPETEER_DISABLE_HEADLESS_WARNING'])
) {
console.warn(
diff --git a/packages/puppeteer/src/getConfiguration.ts b/packages/puppeteer/src/getConfiguration.ts
index d682bac4..462ea593 100644
--- a/packages/puppeteer/src/getConfiguration.ts
+++ b/packages/puppeteer/src/getConfiguration.ts
@@ -24,6 +24,12 @@ export const getConfiguration = (): Configuration => {
const result = cosmiconfigSync('puppeteer').search();
const configuration: Configuration = result ? result.config : {};
+ configuration.logLevel = (process.env['PUPPETEER_LOGLEVEL'] ??
+ process.env['npm_config_LOGLEVEL'] ??
+ process.env['npm_package_config_LOGLEVEL'] ??
+ configuration.logLevel ??
+ 'warn') as 'silent' | 'error' | 'warn';
+
// Merging environment variables.
configuration.defaultProduct = (process.env['PUPPETEER_PRODUCT'] ??
process.env['npm_config_puppeteer_product'] ??
@@ -57,11 +63,25 @@ export const getConfiguration = (): Configuration => {
process.env['npm_config_puppeteer_browser_revision'] ??
process.env['npm_package_config_puppeteer_browser_revision'] ??
configuration.browserRevision;
- configuration.downloadHost =
+
+ const downloadHost =
process.env['PUPPETEER_DOWNLOAD_HOST'] ??
process.env['npm_config_puppeteer_download_host'] ??
- process.env['npm_package_config_puppeteer_download_host'] ??
- configuration.downloadHost;
+ process.env['npm_package_config_puppeteer_download_host'];
+
+ if (downloadHost && configuration.logLevel === 'warn') {
+ console.warn(
+ `PUPPETEER_DOWNLOAD_HOST is deprecated. Use PUPPETEER_DOWNLOAD_BASE_URL instead.`
+ );
+ }
+
+ configuration.downloadBaseUrl =
+ process.env['PUPPETEER_DOWNLOAD_BASE_URL'] ??
+ process.env['npm_config_puppeteer_download_base_url'] ??
+ process.env['npm_package_config_puppeteer_download_base_url'] ??
+ configuration.downloadBaseUrl ??
+ downloadHost;
+
configuration.downloadPath =
process.env['PUPPETEER_DOWNLOAD_PATH'] ??
process.env['npm_config_puppeteer_download_path'] ??
@@ -83,11 +103,6 @@ export const getConfiguration = (): Configuration => {
configuration.experiments ??= {};
- configuration.logLevel = (process.env['PUPPETEER_LOGLEVEL'] ??
- process.env['npm_config_LOGLEVEL'] ??
- process.env['npm_package_config_LOGLEVEL'] ??
- configuration.logLevel) as 'silent' | 'error' | 'warn';
-
// Validate configuration.
if (!isSupportedProduct(configuration.defaultProduct)) {
throw new Error(`Unsupported product ${configuration.defaultProduct}`);
diff --git a/packages/puppeteer/src/node/install.ts b/packages/puppeteer/src/node/install.ts
index f3cd7587..5017c957 100644
--- a/packages/puppeteer/src/node/install.ts
+++ b/packages/puppeteer/src/node/install.ts
@@ -46,7 +46,7 @@ export async function downloadBrowser(): Promise