Skip to content

Adding Profile Setting to RSelenium Firefox #289

@Vanderser

Description

@Vanderser

I am using Windows 7, I have both chrome webdriver version 108.0.5359.71 and geckodriver with version 0.34.0, and also installed mozilla firefox browser with version 115, In this case I am trying to reach web.whatsapp.com by both chrome and firefox for comparisons.

With chrome, I actually can surf the whatsapp web (automatically bypass the qr-code), with these settings:

user_agent <- "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.5359.71 Safari/537.36"
language <- "en-US,en;q=0.5"
accept_language <- "en-US,en;q=0.9"
platform <- "Windows NT 6.1; Win64; x64"
chrome_user_data_dir <- "C:\\Users\\User\\AppData\\Local\\Google\\Chrome\\User Data"
firefox_user_data_dir <- "C:\\Users\\User\\AppData\\Local\\Mozilla\\Firefox\\Profiles"

options <- list(
      chromeOptions = list(
        args = c(
          paste0("--user-agent=", user_info$user_agent),
          paste0("--lang=", user_info$language),
          paste0("--user-data-dir=",chrome_user_data_dir)
        )
      )
    )

rD <- rsDriver(browser="firefox", port = 4567L, chromever = NULL, verbose=F, 
               extraCapabilities = options)
remDr <- rD[["client"]]
remDr$navigate("https://web.whatsapp.com/")

However I need to access the whatsapp web using firefox since the chrome browser has known issues/limitation of videos playback element for whatsapp web, which I need to load in my project. These are my current settings for the firefox RSelenium setup:

firefox_profile_template <- list(
    browserName = "firefox",
    "moz:firefoxOptions" = list(
      prefs = list("intl.accept_languages" = language),
      args = list(paste0("--user-agent=", user_agent), paste0("--user-data-dir=", user_data_dir))
    )
  )
)
    
rD <- rsDriver(browser="firefox", port = 4567L, chromever = NULL, verbose=F, 
               extraCapabilities = firefox_profile_template)
remDr <- rD[["client"]]
remDr$navigate("https://web.whatsapp.com/")

And unfortunately these settings still make it stuck at whatsapp qr-code everytime the code run. I dont have any clue to solve this since its my first experience to attach user profile to firefox.

These are Note with pictures before navigate to web.whatsapp.com:

Actual Firefox Browser:

1

RSelenium firefox launch:

2

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