summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Buckley-Houston <tom@tombh.co.uk>2018-11-06 18:06:07 +0900
committerThomas Buckley-Houston <tom@tombh.co.uk>2018-11-06 21:14:42 +0900
commitaedcdb388f3762953f4929d72b09c56fea80f435 (patch)
treeb13e539f648efd3114e483f600ffbccbf24d6912
parent2afe57b02f709a1e101fe92562e5dab376314c77 (diff)
Update FF Marionette commands
In Firefox 63 an old syntax for Marionette commands was deprecated. Updating mostly just meant prepending `WebDriver` to existing commands. This should fix most problems in #232
-rw-r--r--.travis.yml2
-rw-r--r--README.md2
-rw-r--r--interfacer/src/browsh/firefox.go12
3 files changed, 8 insertions, 8 deletions
diff --git a/.travis.yml b/.travis.yml
index 994f15f..4cd7bad 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -5,7 +5,7 @@ go:
addons:
# Use the full version number with ".0" if needed. This value is scraped by setup scripts.
- firefox: "60.0"
+ firefox: "63.0"
apt:
packages:
- rpm
diff --git a/README.md b/README.md
index 25eacc1..b3a2f24 100644
--- a/README.md
+++ b/README.md
@@ -36,7 +36,7 @@ is running somewhere else on mains electricity.
## Installation
Download a binary from the [releases](https://github.com/browsh-org/browsh/releases) (~7MB).
-You will need to have [Firefox 57](https://www.mozilla.org/en-US/firefox/new/) (or higher) aleady installed.
+You will need to have [Firefox 63](https://www.mozilla.org/en-US/firefox/new/) (or higher) aleady installed.
Or download and run the Docker image (~230MB) with:
`docker run --rm -it browsh/browsh`
diff --git a/interfacer/src/browsh/firefox.go b/interfacer/src/browsh/firefox.go
index da6d6c1..3154c35 100644
--- a/interfacer/src/browsh/firefox.go
+++ b/interfacer/src/browsh/firefox.go
@@ -214,7 +214,7 @@ func firefoxMarionette() {
}
marionette = conn
readMarionette()
- sendFirefoxCommand("newSession", map[string]interface{}{})
+ sendFirefoxCommand("WebDriver:NewSession", map[string]interface{}{})
}
// Install the Browsh extension that was bundled with `go-bindata` under
@@ -228,20 +228,20 @@ func installWebextension() {
defer os.Remove(file.Name())
ioutil.WriteFile(file.Name(), []byte(data), 0644)
args := map[string]interface{}{"path": file.Name()}
- sendFirefoxCommand("addon:install", args)
+ sendFirefoxCommand("Addon:Install", args)
}
// Set a Firefox preference as you would in `about:config`
// `value` needs to be supplied with quotes if it's to be used as a JS string
func setFFPreference(key string, value string) {
- sendFirefoxCommand("setContext", map[string]interface{}{"value": "chrome"})
+ sendFirefoxCommand("Marionette:SetContext", map[string]interface{}{"value": "chrome"})
script := fmt.Sprintf(`
Components.utils.import("resource://gre/modules/Preferences.jsm");
prefs = new Preferences({defaultBranch: false});
prefs.set("%s", %s);`, key, value)
args := map[string]interface{}{"script": script}
- sendFirefoxCommand("executeScript", args)
- sendFirefoxCommand("setContext", map[string]interface{}{"value": "content"})
+ sendFirefoxCommand("WebDriver:ExecuteScript", args)
+ sendFirefoxCommand("Marionette:SetContext", map[string]interface{}{"value": "content"})
}
// Consume output from Marionette, we don't do anything with it. It"s just
@@ -309,5 +309,5 @@ func startFirefox() {
}
func quitFirefox() {
- sendFirefoxCommand("quitApplication", map[string]interface{}{})
+ sendFirefoxCommand("Marionette:Quit", map[string]interface{}{})
}