I am able to launch the shiny app when chrome browser is already open in my desktop (linux). However, with my browser closed, and I launch the shiny app, it just shows a blank page and "waiting 127.0.0.1 ..." in lower status bar. In other words, it launches chrome but does not show the shiny app content. Here is my code:
library(shiny)
library(shinyBS)
launch.browser = function(appUrl, browser.path='/usr/bin/chromium-browser') {
system(sprintf('"%s" --disable-gpu --app="data:text/html,<html>
<head>
<title>Configuration</title>
</head>
<body>
<script>window.resizeTo(800,500);window.location=\'%s\';</script>
</body></html>"', browser.path, appUrl))
}
shinyApp(
ui = fluidPage(
fluidRow(
br(),
wellPanel(
fluidRow(
h4('User Information')
),
fluidRow(
column(4,
textInput('Name', 'Full Name', value = "")
),
column(4,
numericInput('accNum', 'Account Number', value = "")
),
column(4,
textInput('token', 'Account Token', value = "")
)
)
)
),
fluidRow(
column(12,
actionButton('save', 'Save')
)
),
bsTooltip(id = "accNum", title = "Enter Lending Club account number",
placement = "bottom", trigger = "hover")
# tags$head(tags$style(type="text/css", "#accNum {width: 100px}"))
),
server = function(input, output, session) {
session$onSessionEnded(function() {
stopApp()
})
observe({
if (input$save == 0)
return()
isolate({
j<<-input$accNum
})
})
},
options = list(launch.browser=launch.browser)
)
Thanks for any help
* Edit 1 *
I have verified that the browser starts fine and goes to a specified URL outside of shiny:
system('/usr/bin/chromium-browser --disable-gpu --app="data:text/html,<html>
<head>
<title>Configuration</title>
</head>
<body>
<script>window.resizeTo(800,500);window.location=\'http://www.facebook.com\';</script>
</body></html>"')
The above also works inside shiny using the location facebook.com. However, when I change it to appUrl parameter it never connects. I also verified that the source of the page is pointing to the correct 127.0.0.1:3189, however, it looks like shiny is not responding for some reason...