rstudio / chromote

Chrome Remote Interface for R
https://rstudio.github.io/chromote/
155 stars 20 forks source link

$view() doesn't work with RStudio Pro #10

Open alandipert opened 5 years ago

alandipert commented 5 years ago

I noticed that b$view() doesn't work with RStudio Pro. When I run it, I get a blank tab. bview

DivadNojnarg commented 2 years ago

Poke @schloerke

Found a dirty workaround:

From my local mac with X11 installed, I ssh into the RStudio Workbench instance:

ssh -X user@host 

Rigth after successful ssh, from the remote I start chrome:

google-chrome --no-sandbox

I can log to RStudio Workbench and start the AppDriver:

library(shinytest2)
headless_app <- AppDriver$new(
  app_dir = "<APP_DIR>",
  name = "monkey-test"
)

Extract the chrome debug port:

chromote::default_chromote_object()$get_browser()$get_port()

Query the DevTools API to get the devtoolsFrontendUrl:

jsonlite::fromJSON("http://127.0.0.1:<CHROME_DEBUG_PORT>/json")

Then, copy the returned url into the local X11 Chrome window (screenshot):

http://127.0.0.1:33085/devtools/inspector.html?ws=127.0.0.1:33085/devtools/page/B1F16CB5BAFAE835F4AC40A7C0F2517C
Screenshot 2022-03-19 at 08 14 26