From bd7c34303d67870c217b23145d11f8550a471539 Mon Sep 17 00:00:00 2001 From: lino-levan <11367844+lino-levan@users.noreply.github.com> Date: Tue, 22 Aug 2023 12:12:00 -0700 Subject: [PATCH] feat: launch args --- src/browser.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/browser.ts b/src/browser.ts index 39741c8..f271ac0 100644 --- a/src/browser.ts +++ b/src/browser.ts @@ -132,6 +132,7 @@ export interface LaunchOptions { headless?: boolean; path?: string; product?: "chrome" | "firefox"; + args?: string[]; } /** @@ -140,6 +141,7 @@ export interface LaunchOptions { export async function launch(opts?: LaunchOptions) { const headless = opts?.headless ?? true; const product = opts?.product ?? "chrome"; + const args = opts?.args ?? []; let path = opts?.path; if (!path) { @@ -158,6 +160,7 @@ export async function launch(opts?: LaunchOptions) { ...( headless ? [product === "chrome" ? "--headless=new" : "--headless"] : [] ), + ...args, ], stderr: "piped", });