mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
feat(Launcher): Allow environment variables definition when launching chromium (#912)
This patch adds `env` option to the `puppeteer.launch` method to define custom environment variables to the launched chrome.
This commit is contained in:
committed by
Andrey Lushnikov
parent
97e40e6823
commit
c225b93037
@@ -89,7 +89,14 @@ class Launcher {
|
||||
if (Array.isArray(options.args))
|
||||
chromeArguments.push(...options.args);
|
||||
|
||||
const chromeProcess = childProcess.spawn(chromeExecutable, chromeArguments, {detached: true});
|
||||
const chromeProcess = childProcess.spawn(
|
||||
chromeExecutable,
|
||||
chromeArguments,
|
||||
{
|
||||
detached: true,
|
||||
env: options.env || process.env
|
||||
}
|
||||
);
|
||||
if (options.dumpio) {
|
||||
chromeProcess.stdout.pipe(process.stdout);
|
||||
chromeProcess.stderr.pipe(process.stderr);
|
||||
|
||||
Reference in New Issue
Block a user