chromedp/runner/path_unix.go

32 lines
620 B
Go
Raw Normal View History

2017-01-24 15:09:23 +00:00
// +build linux freebsd netbsd openbsd
package runner
import "os/exec"
const (
// DefaultChromePath is the default path to the google-chrome executable if
// a variant cannot be found on $PATH.
2017-01-24 15:09:23 +00:00
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",
2017-01-24 15:09:23 +00:00
"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
}