Skip to content

Commit 5beca76

Browse files
committed
detect Windows paths
1 parent 1f25a8f commit 5beca76

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

lib/ferrum/browser/options/base.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ def except(*keys)
2626
def detect_path
2727
if Ferrum.mac?
2828
self.class::MAC_BIN_PATH.find { |n| File.exist?(n) }
29+
elsif Ferrum.windows?
30+
self.class::WINDOWS_BIN_PATH.find { |path| File.exist?(path) }
2931
else
3032
self.class::LINUX_BIN_PATH.find do |name|
3133
path = Cliver.detect(name) and break(path)

lib/ferrum/browser/options/chrome.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ class Chrome < Base
4949
LINUX_BIN_PATH = %w[chromium google-chrome-unstable google-chrome-beta
5050
google-chrome chrome chromium-browser
5151
google-chrome-stable].freeze
52+
WINDOWS_BIN_PATH = [
53+
"C:/Program Files/Google/Chrome Dev/Application/chrome.exe",
54+
"C:/Program Files/Google/Chrome/Application/chrome.exe"
55+
].freeze
5256

5357
def merge_required(flags, options, user_data_dir)
5458
port = options.fetch(:port, BROWSER_PORT)

lib/ferrum/browser/options/firefox.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ class Firefox < Base
1212
"/Applications/Firefox.app/Contents/MacOS/firefox-bin"
1313
].freeze
1414
LINUX_BIN_PATH = %w[firefox].freeze
15+
WINDOWS_BIN_PATH = [
16+
"C:/Program Files/Firefox Developer Edition/firefox.exe",
17+
"C:/Program Files/Mozilla Firefox/firefox.exe"
18+
].freeze
1519

1620
def merge_required(flags, options, user_data_dir)
1721
port = options.fetch(:port, BROWSER_PORT)

0 commit comments

Comments
 (0)