Skip to content

Commit

Permalink
Use the new headless Chrome on the pre-registered driver (#2726)
Browse files Browse the repository at this point in the history
Earlier this year (2023), Chrome released Chrome for Testing, a new
Chrome flavor that targets the testing and automation use cases. This
flavor is accessible using the `--headless=new` option since Chrome 109,
released January 1, 2023. This new mode supports the full browser
capabilities, including running extensions.

The default headless mode is still pointed to `--headless=old` for now,
but it's planned to be changed to `new` over time.

This commit explicitly chooses the `new` headless mode, that uses Chrome
for Testing.
  • Loading branch information
neilvcarvalho authored Dec 11, 2023
1 parent 10c097f commit e2f9f6c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/capybara/registrations/drivers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
version = Capybara::Selenium::Driver.load_selenium
options_key = Capybara::Selenium::Driver::CAPS_VERSION.satisfied_by?(version) ? :capabilities : :options
browser_options = Selenium::WebDriver::Chrome::Options.new.tap do |opts|
opts.add_argument('--headless')
opts.add_argument('--headless=new')
opts.add_argument('--disable-gpu') if Gem.win_platform?
# Workaround https://bugs.chromium.org/p/chromedriver/issues/detail?id=2650&q=load&sort=-id&colspec=ID%20Status%20Pri%20Owner%20Summary
opts.add_argument('--disable-site-isolation-trials')
Expand Down

0 comments on commit e2f9f6c

Please sign in to comment.