playwright-community / playwright-go

Playwright for Go a browser automation library to control Chromium, Firefox and WebKit with a single API.
https://playwright-community.github.io/playwright-go/
MIT License
1.94k stars 144 forks source link

Add run option to install browsers with dependencies #416

Open Andrzej opened 4 months ago

Andrzej commented 4 months ago

Currently, it is possible to install Playwright with its dependencies from Golang by using this syntax:

err := playwright.Install(&playwright.RunOptions{Browsers: []string{"--with-deps"}})

This PR introduces a more elegant solution:

err := playwright.Install(&playwright.RunOptions{WithDependencies: true})
canstand commented 4 months ago

Installing dependencies requires root permissions. If the program cannot switch to root permissions, it will cause a hang. So it is not recommended to add this option.