playwright-go icon indicating copy to clipboard operation
playwright-go copied to clipboard

How Can I provide flags to the browsers?

Open jyepesr1 opened this issue 2 years ago • 1 comments

When I execute codegen, I want to run the chromium browser with the following flags

chromium --disable-dev-shm-usage --disable-blink-features=AutomationControlled --disable-component-extensions-with-background-pages

Is there any way I can provide those flags?

jyepesr1 avatar Jan 26 '23 17:01 jyepesr1

would this help?

pw, err := playwright.Run()
if err != nil {
  log.Fatalf("could not launch playwright: %v", err)
}
browser, err := pw.Chromium.Launch(playwright.BrowserTypeLaunchOptions{
  Args:     []string{"--disable-dev-shm-usage", "--disable-blink-features=AutomationControlled", "--disable-component-extensions-with-background-pages"},
  Headless: playwright.Bool(false),
})
if err != nil {
  log.Fatalf("could not launch Chromium: %v", err)
}

ninadingole avatar Feb 11 '23 14:02 ninadingole