Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save localhostdotdev/3dcec5d0de38ce5842f8e41ff6957b8e to your computer and use it in GitHub Desktop.
Save localhostdotdev/3dcec5d0de38ce5842f8e41ff6957b8e to your computer and use it in GitHub Desktop.
Set window size, proxy, no infobars, no notifications, no google sync, no audio, ublock (ad blocker and more), config for selenium/capybara/chromedriver in ruby
Capybara.register_driver :selenium_chrome do |app|
options = Selenium::WebDriver::Chrome::Options.new
options.add_argument("--window-size=1440,900")
options.add_argument("--proxy-server=localhost:8080")
options.add_argument("--disable-infobars")
options.add_argument("--disable-notifications")
options.add_argument("--disable-sync")
options.add_argument("--mute-audio")
options.add_extension(
File.expand_path("../tmp/ublock.crx", File.dirname(__FILE__))
)
Capybara::Selenium::Driver.new(app, browser: :chrome, options: options)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment