diff --git a/lib/wbench/browser.rb b/lib/wbench/browser.rb index 9ff27e1..2d27440 100644 --- a/lib/wbench/browser.rb +++ b/lib/wbench/browser.rb @@ -10,7 +10,13 @@ def initialize(url, options = {}) selenium_options = { :browser => browser, :http_client => http_client } if options[:user_agent] - add_selenium_args(selenium_options, "--user-agent='#{options[:user_agent]}'") + add_selenif browser == :firefox + profile = Selenium::WebDriver::Firefox::Profile.new + profile['general.useragent.override'] = options[:user_agent] + selenium_options[:profile] = profile + else + add_selenium_args(selenium_options, "--user-agent='#{options[:user_agent]}'") + end end SeleniumDriver.new(app, selenium_options)