Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Allow to skip version check via firefox.ignore-version #513

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions interfacer/src/browsh/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
)
Expand Down
4 changes: 4 additions & 0 deletions interfacer/src/browsh/firefox_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,17 @@ import (
"strings"

"github.com/go-errors/errors"
"github.com/spf13/viper"
)

func getFirefoxPath() string {
return Shell("which firefox")
}

func ensureFirefoxVersion(path string) {
if viper.GetBool("firefox.ignore-version") {
return
}
output := Shell(path + " --version")
pieces := strings.Split(output, " ")
version := pieces[len(pieces)-1]
Expand Down
4 changes: 4 additions & 0 deletions interfacer/src/browsh/firefox_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"strings"

"github.com/go-errors/errors"
"github.com/spf13/viper"
"golang.org/x/sys/windows/registry"
)

Expand Down Expand Up @@ -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]
Expand Down
Loading