diff --git a/lib/ferrum/browser/options/base.rb b/lib/ferrum/browser/options/base.rb index 6ebc63ba..86161eff 100644 --- a/lib/ferrum/browser/options/base.rb +++ b/lib/ferrum/browser/options/base.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require "singleton" +require "open3" module Ferrum class Browser @@ -12,6 +13,14 @@ def self.options instance end + # @return [String, nil] + def self.version + out, _ = Open3.capture2(detect_path, "--version") + out.strip + rescue Errno::ENOENT + nil + end + def to_h self.class::DEFAULT_OPTIONS end