Detecting open solo mode from shiny app?

Hi all,

Hopefully a quick one:

Any suggestions on how to detect open solo mode from within a shiny app?

I aim to hide a navigation button with shiny::conditionalPanel based on whether it's in open solo or not. I've tried hooking into session$clientData$url_pathname but it doesn't change even when the browser navigation bar path is different for the same document.

I can't see any documented environment variables which I could hook into, though I still need to try an env dump just to be sure.

Any other ideas?

This is a really interesting question!! I know there would be a way to do this by sending data back from the frontend (if it's not already).

I'm curious to hear more about why you are using this though - is this hidden panel something that helps you get back to the "dashboard" view?

This example app can help see the data that is exposed to Shiny by default:

Yes I'm just experimenting at the moment, but the button would navigate to a relative location.href via 'onclick'. Currently it takes users back to the dashboard view, but it's behind a proxy so I could turn that into anything I liked.

The relative href doesn't work within the dashboard view, so I was planning to hide it to prevent obvious errors.

This is a fantastic use case!! Very cool!

I will try to package this up into something more usable within R, but it should be do-able (so long as iframe origin stuff doesn't block it) with window.location.href ==


The source:

(And my reference. Everything starts with an SO post :grinning_face_with_smiling_eyes: )

EDIT: Inline in case links break:


js_helpers <- "
function is_solo() {
  alert(window.location.href ==

ui <- fluidPage(

    titlePanel("Determine if Open Solo"),


                "Is this open solo?",
                onclick = "is_solo();"

server <- function(input, output) {

shinyApp(ui = ui, server = server)
1 Like

Very clever, & nice & simple too.

Many thanks Cole!


1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.