chromote icon indicating copy to clipboard operation
chromote copied to clipboard

Preferences support

Open deepanshu88 opened this issue 3 years ago • 1 comments

Does chromote support prefs like RSelenium? See example of prefs. Here it translates web page to English.

library(RSelenium)
shell('docker run -d -p 4445:4444 selenium/standalone-chrome')

eCaps <- list(chromeOptions = list(args = c('--disable-gpu','--window-size=1920,1080', '--lang=en'),
                                   prefs = list(translate_whitelists=list('ru' = 'en'),
                                                translate=list('enabled'='true'))))
                                                
remDr <- RSelenium::remoteDriver(remoteServerAddr = "localhost", port = 4445L, browserName = "chrome", extraCapabilities = eCaps)

remDr$open(silent = TRUE)
remDr$navigate("http://premier.gov.ru/events/")

I found args in Chrome$new( ) but could not find prefs.

a <- chromote::Chromote$new(
  browser = chromote::Chrome$new(
    path = chromote::find_chrome(),
    args = c('--start-maximized')
  )
)

b <- a$new_session()
b$Page$navigate("https://www.google.com/")
b$view()

deepanshu88 avatar Jun 08 '21 17:06 deepanshu88

@deepanshu88 I think you're mostly likely to get help if you could figure out what exactly the preferences do in RSelenium and what features of chromium they correspond to

hadley avatar Jan 30 '24 19:01 hadley