Skip to content

Commit

Permalink
fix user-agent-option for firefox
Browse files Browse the repository at this point in the history
  • Loading branch information
yshnb committed Feb 9, 2014
1 parent 2ebf9fe commit 8ce9229
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/wbench/browser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 8ce9229

Please sign in to comment.