diff --git a/src/api.ts b/src/api.ts index 3390c848..546fddd4 100644 --- a/src/api.ts +++ b/src/api.ts @@ -44,6 +44,7 @@ export default class Chromeless implements Promise { closeTab: true, ...options.cdp, }, + chromeFlags: ['--headless'], } const chrome = mergedOptions.remote diff --git a/src/chrome/local.ts b/src/chrome/local.ts index 25aed174..c0388e60 100644 --- a/src/chrome/local.ts +++ b/src/chrome/local.ts @@ -38,6 +38,7 @@ export default class LocalChrome implements Chrome { this.chromeInstance = await launch({ logLevel: this.options.debug ? 'info' : 'silent', port: this.options.cdp.port, + chromeFlags: this.options.chromeFlags, }) return await CDP({ port: this.chromeInstance.port }) } diff --git a/src/types.ts b/src/types.ts index 16698bf5..1de7b804 100644 --- a/src/types.ts +++ b/src/types.ts @@ -50,6 +50,7 @@ export interface ChromelessOptions { launchChrome?: boolean // auto-launch chrome (local) `true` cdp?: CDPOptions remote?: RemoteOptions | boolean + chromeFlags?: Array } export interface Chrome {