diff --git a/interfacer/src/browsh/config.go b/interfacer/src/browsh/config.go index 0ed4583..04c474b 100644 --- a/interfacer/src/browsh/config.go +++ b/interfacer/src/browsh/config.go @@ -24,6 +24,7 @@ var ( _ = pflag.String("firefox.path", "firefox", "Path to Firefox executable") _ = pflag.Bool("firefox.with-gui", false, "Don't use headless Firefox") _ = pflag.Bool("firefox.use-existing", false, "Whether Browsh should launch Firefox or not") + _ = pflag.Bool("firefox.ignore-version", false, "Whether Browsh should launch Firefox regardless of its version or not") _ = pflag.Bool("monochrome", false, "Start browsh in monochrome mode") _ = pflag.Bool("name", false, "Print out the name: Browsh") ) diff --git a/interfacer/src/browsh/firefox_unix.go b/interfacer/src/browsh/firefox_unix.go index 57f6ea6..8aff128 100644 --- a/interfacer/src/browsh/firefox_unix.go +++ b/interfacer/src/browsh/firefox_unix.go @@ -6,6 +6,7 @@ import ( "strings" "github.com/go-errors/errors" + "github.com/spf13/viper" ) func getFirefoxPath() string { @@ -13,6 +14,9 @@ func getFirefoxPath() string { } func ensureFirefoxVersion(path string) { + if viper.GetBool("firefox.ignore-version") { + return + } output := Shell(path + " --version") pieces := strings.Split(output, " ") version := pieces[len(pieces)-1] diff --git a/interfacer/src/browsh/firefox_windows.go b/interfacer/src/browsh/firefox_windows.go index 7bb1c08..b76df74 100644 --- a/interfacer/src/browsh/firefox_windows.go +++ b/interfacer/src/browsh/firefox_windows.go @@ -8,6 +8,7 @@ import ( "strings" "github.com/go-errors/errors" + "github.com/spf13/viper" "golang.org/x/sys/windows/registry" ) @@ -97,6 +98,9 @@ func getFirefoxFlavor() string { } func ensureFirefoxVersion(path string) { + if viper.GetBool("firefox.ignore-version") { + return + } versionString := getWindowsFirefoxVersionString() pieces := strings.Split(versionString, " ") version := pieces[0]