playwright-go
playwright-go copied to clipboard
How Can I provide flags to the browsers?
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?
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)
}