Permalink
Browse files

Improve headless chrome detection

  • Loading branch information...
twalpole committed Jun 14, 2017
1 parent 21844c7 commit db779f3b0d32cb787fd1a3329f68afdf5b4235d2
Showing with 8 additions and 1 deletion.
  1. +8 −1 lib/capybara/selenium/driver.rb
@@ -308,9 +308,16 @@ def chrome?
# @api private
def headless_chrome?
chrome? && ((@processed_options[:desired_capabilities][:chrome_options] || {})['args'] || []).include?("headless")
if chrome?
caps = @processed_options[:desired_capabilities]
chrome_options = caps[:chrome_options] || caps[:chromeOptions] || {}
args = chrome_options['args'] || chrome_options[:args] || []
return args.include?("headless")
end
return false
end
# @deprecated This method is being removed
def browser_initialized?
super && !@browser.nil?

0 comments on commit db779f3

Please sign in to comment.