Open in the browser when shiny.launch.browser is TRUE
See original GitHub issueIs your feature request related to a problem? Please describe.
One current point of friction when using R with VSCode is that the options(shiny.launch.browser = TRUE)
doesn’t open the shiny app in the default web browser — the default behavior in the RStudio IDE. https://shiny.rstudio.com/reference/shiny/0.14/shiny-options.html
Right now it opens in a VSCode tab, and you have to pop it out to get in the browser. That’s kind of not complex per se, but you end up doing that a lot and with a lot of useless tabs in VSCode you have to manually close.
Describe the solution you’d like
I’d love the shiny app to be opened in the web browser whenever shiny.launch.browser
is TRUE.
Describe alternatives you’ve considered
I don’t think there are any alternatives so far.
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (6 by maintainers)
Yes, shiny.launch.browser = TRUE opens the default web browser, shiny.launch.browser = FALSE will not open anything (it currently works as expected), and you can also do
options(shiny.launch.browser = rstudioapi::viewer)
to force the view in the RStudio viewer. Not sure if this last should be supported or not, and how?Awesome, thanks a lot !!
In case it can help, what shiny does for displaying the app is :
launch.browser = getOption('shiny.launch.browser', interactive()),
=> if the option is not set, it defaults to TRUE in interactive sessions https://github.com/rstudio/shiny/blob/main/R/runapp.R#L89if it’s a function (when
options(shiny.launch.browser = rstudioapi::viewer)
), it uses this function, otherwise it callsbrowseURL
https://github.com/rstudio/shiny/blob/main/R/runapp.R#L364browseURL()
in VSCode will open the local content in itself, otherwise in the browserWhereas opening a local html will render inside VSCode (hence the opening of the local shiny app inside VSCode).
Also, you could use
to force opening shiny apps in external web browser.