Fix for Viper's lowercasing of config keys :/

See spf13/viper#635
pull/286/head v1.6.1
Thomas Buckley-Houston 2019-06-18 19:05:08 +03:00
rodzic fc92642a4c
commit 81f41b7b4c
3 zmienionych plików z 17 dodań i 8 usunięć

Wyświetl plik

@ -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.

Wyświetl plik

@ -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])
}
}

Wyświetl plik

@ -1,3 +1,3 @@
package browsh
var browshVersion = "1.6.0"
var browshVersion = "1.6.1"