fix: implement flag for disabling headless warning (#10073)

This commit is contained in:
Nikolay Vitkov 2023-04-25 16:30:46 +02:00 committed by GitHub
parent 35424cbc2b
commit cfe9bbc852
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -48,7 +48,9 @@ export class ChromeLauncher extends ProductLauncher {
const headless = options.headless ?? true;
if (
headless === true &&
this.puppeteer.configuration.logLevel !== 'silent'
(!this.puppeteer.configuration.logLevel ||
this.puppeteer.configuration.logLevel === 'warn') &&
!Boolean(process.env['PUPPETEER_DISABLE_HEADLESS_WARNING'])
) {
console.warn(
[