summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Buckley-Houston <tom@tombh.co.uk>2019-06-18 19:05:08 +0300
committerThomas Buckley-Houston <tom@tombh.co.uk>2019-06-19 08:12:37 +0300
commit81f41b7b4ce4587f0e2a65df424e612063dca17e (patch)
treeb631c0b0b5a794953e3224127c77266c7faf2696
parentfc92642a4c345e9923ea3aaef1f448a8e43bac7d (diff)
Fix for Viper's lowercasing of config keys :/v1.6.1
See spf13/viper#635
-rw-r--r--interfacer/src/browsh/config_sample.go11
-rw-r--r--interfacer/src/browsh/firefox.go12
-rw-r--r--interfacer/src/browsh/version.go2
3 files changed, 17 insertions, 8 deletions
diff --git a/interfacer/src/browsh/config_sample.go b/interfacer/src/browsh/config_sample.go
index 5ecaf30..9ee24b9 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 d78b412..6108ba7 100644
--- a/interfacer/src/browsh/firefox.go
+++ b/interfacer/src/browsh/firefox.go
@@ -219,7 +219,7 @@ func firefoxMarionette() {
Shutdown(errors.New("Failed to connect to Firefox's Marionette within 30 seconds"))
}
marionette = conn
- readMarionette()
+ go readMarionette()
sendFirefoxCommand("WebDriver:NewSession", map[string]interface{}{})
}
@@ -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]))
}
@@ -270,15 +271,16 @@ func sendFirefoxCommand(command string, args map[string]interface{}) {
message := fmt.Sprintf("%d:%s", len(marshalled), marshalled)
fmt.Fprintf(marionette, message)
ffCommandCount++
- readMarionette()
+ go readMarionette()
}
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 b807292..341f6a1 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"