Skip to content

Enable Chrome to translate a page #205

Closed

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

  1. route commented on Aug 22, 2022

    @route
    Member
    1. You didn't say what is not working and what is the issue.
    2. Double check that translation feature works at all in headless Chrome, because for example plugins don't.
  2. locked and limited conversation to collaborators on Aug 22, 2022
  3. converted this issue into a discussion #206 on Aug 22, 2022
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