From 2b0a0c8f063eeffe8127c472f731cfde73648445 Mon Sep 17 00:00:00 2001
From: Anton Paulovich
Date: Sat, 31 Oct 2020 17:34:40 +0300
Subject: [PATCH] Provide a way to configure location of executable in
customLauncher
Fix #125
---
README.md | 21 +++++++++++++++++++++
index.js | 2 +-
2 files changed, 22 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 5c1b18d..ada4daa 100644
--- a/README.md
+++ b/README.md
@@ -47,6 +47,27 @@ environment variables:
* `FIREFOX_NIGHTLY_BIN` (for browser `FirefoxNightly` or
`FirefoxNightlyHeadless`)
+### Custom Firefox location
+
+In addition to Environment variables you can specify location of the Firefox executable in a custom launcher:
+
+```js
+browsers: ['Firefox68', 'Firefox78'],
+
+customLaunchers: {
+ Firefox68: {
+ base: 'Firefox',
+ name: 'Firefox68',
+ command: '/firefox.exe'
+ },
+ Firefox78: {
+ base: 'Firefox',
+ name: 'Firefox78',
+ command: '/firefox.exe'
+ }
+}
+```
+
### Custom Preferences
To configure preferences for the Firefox instance that is loaded, you can specify a custom launcher in your Karma
config with the preferences under the `prefs` key:
diff --git a/index.js b/index.js
index dfac576..57308cb 100755
--- a/index.js
+++ b/index.js
@@ -195,7 +195,7 @@ var FirefoxBrowser = function (id, baseBrowserDecorator, args) {
this._start = function (url) {
var self = this
- var command = this._getCommand()
+ var command = args.command || this._getCommand()
var profilePath = args.profile || self._tempDir
var flags = args.flags || []
var extensionsDir