Skip to content

Enable Chrome to translate a page #205

Description

@nicolas-besnard

I'm using Cuprite to crawl some websites and I'd like to translate the page.

By looking at Ferrum codebase, there's a Ferrum::Browser::Options::Chrome::DEFAULT_OPTIONS object.

So when configuring Capybara, I'm using ignore_default_browser_options, and only re-use this DEFAULT_OPTIONS and exclude the key I don't want

Capybara::Cuprite::Driver.new(
    app,
    {
      ignore_default_browser_options: true,
      window_size: [1200, 800],
      browser_options: { 'no-sandbox': nil }.merge(Ferrum::Browser::Options::Chrome::DEFAULT_OPTIONS.except(
        "disable-features",
        "disable-translate",
        "headless"
        )),
      headless: false,
    }
  )

But it doesn't seem to work. I have 2 questions:

  1. Is it possible to re-enable this feature?
  2. Is it possible to interact with the "translate UI" to accept the translation from Chrome?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions