Skip to content

Commit

Permalink
Merge pull request #7 from lino-levan/feat-launch-args
Browse files Browse the repository at this point in the history
feat: launch args
  • Loading branch information
lino-levan authored Aug 22, 2023
2 parents dfb1f2a + bd7c343 commit 4c30291
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ export interface LaunchOptions {
headless?: boolean;
path?: string;
product?: "chrome" | "firefox";
args?: string[];
}

/**
Expand All @@ -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) {
Expand All @@ -158,6 +160,7 @@ export async function launch(opts?: LaunchOptions) {
...(
headless ? [product === "chrome" ? "--headless=new" : "--headless"] : []
),
...args,
],
stderr: "piped",
});
Expand Down

0 comments on commit 4c30291

Please sign in to comment.