chromedp/runner/path_unix.go

31 lines
578 B
Go

// +build linux freebsd netbsd openbsd
package runner
import "os/exec"
const (
// DefaultChromePath is the default path to the google-chrome executable.
DefaultChromePath = "/usr/bin/google-chrome"
)
// chromeNames are the Chrome executable names to search for in the path.
var chromeNames = []string{
"google-chrome",
"chromium-browser",
"chromium",
"google-chrome-beta",
"google-chrome-unstable",
}
func findChromePath() string {
for _, p := range chromeNames {
path, err := exec.LookPath(p)
if err == nil {
return path
}
}
return DefaultChromePath
}