diff --git a/ee/desktop/user/menu/action_open_url_linux.go b/ee/desktop/user/menu/action_open_url_linux.go index 813bf5ab3..51026234b 100644 --- a/ee/desktop/user/menu/action_open_url_linux.go +++ b/ee/desktop/user/menu/action_open_url_linux.go @@ -4,11 +4,23 @@ package menu import ( + "fmt" "os/exec" ) -// open opens the specified URL in the default browser of the user -// See https://stackoverflow.com/a/39324149/1705598 +var browserLaunchers = []string{"xdg-open", "x-www-browser"} + func open(url string) error { - return exec.Command("xdg-open", url).Start() + errList := make([]error, 0) + for _, browserLauncher := range browserLaunchers { + cmd := exec.Command(browserLauncher, url) + if err := cmd.Start(); err != nil { + errList = append(errList, fmt.Errorf("could not open browser with %s: %w", browserLauncher, err)) + continue + } + + // Successfully opened URL, nothing else to do here + return nil + } + return fmt.Errorf("could not successfully open browser with any given launchers: %+v", errList) }