From f290601e115934c09f48d4312663cca853a8cdb8 Mon Sep 17 00:00:00 2001 From: Thomas Buckley-Houston Date: Tue, 18 Jun 2019 19:05:08 +0300 Subject: [PATCH] Fix for Viper's lowercasing of config keys :/ See spf13/viper#635 --- interfacer/src/browsh/config_sample.go | 11 +++++++++-- interfacer/src/browsh/firefox.go | 8 +++++--- interfacer/src/browsh/version.go | 2 +- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/interfacer/src/browsh/config_sample.go b/interfacer/src/browsh/config_sample.go index 5ecaf303..9ee24b9f 100644 --- a/interfacer/src/browsh/config_sample.go +++ b/interfacer/src/browsh/config_sample.go @@ -42,8 +42,15 @@ use-existing = false with-gui = false # Config that you might usually set through Firefox's 'about:config' page -[firefox-config] -# "privacy.resistFingerprinting" = true +# Note that string must be wrapped in quotes +# preferences = [ +# "privacy.resistFingerprinting=true", +# "network.proxy.http='localhost'", +# "network.proxy.ssl='localhost'", +# "network.proxy.http_port=8118", +# "network.proxy.ssl_port=8118", +# "network.proxy.type=1" +# ] [tty] # The time in milliseconds between requesting a new TTY-sized pixel frame. diff --git a/interfacer/src/browsh/firefox.go b/interfacer/src/browsh/firefox.go index d78b4128..f93fc467 100644 --- a/interfacer/src/browsh/firefox.go +++ b/interfacer/src/browsh/firefox.go @@ -258,7 +258,8 @@ func readMarionette() { buffer := make([]byte, 4096) count, err := marionette.Read(buffer) if err != nil { - Shutdown(err) + Log("Error reading from Marionette connection") + return } Log("FF-MRNT: " + string(buffer[:count])) } @@ -277,8 +278,9 @@ func setDefaultFirefoxPreferences() { for key, value := range defaultFFPrefs { setFFPreference(key, value) } - for key, value := range viper.GetStringMapString("firefox-config") { - setFFPreference(key, value) + for _, pref := range viper.GetStringSlice("firefox.preferences") { + parts := strings.SplitN(pref, "=", 2) + setFFPreference(parts[0], parts[1]) } } diff --git a/interfacer/src/browsh/version.go b/interfacer/src/browsh/version.go index b8072922..341f6a12 100644 --- a/interfacer/src/browsh/version.go +++ b/interfacer/src/browsh/version.go @@ -1,3 +1,3 @@ package browsh -var browshVersion = "1.6.0" +var browshVersion = "1.6.1"