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 == window.top.location.href)
https://colorado.rstudio.com/rsc/connect/#/apps/b4ffeb62-3290-4227-829d-799e10bd802b/access
vs.
https://colorado.rstudio.com/rsc/cole/shiny-open-solo/
The source:
(And my reference. Everything starts with an SO post
)
EDIT: Inline in case links break:
library(shiny)
js_helpers <- "
function is_solo() {
alert(window.location.href == window.top.location.href)
}
"
ui <- fluidPage(
titlePanel("Determine if Open Solo"),
tags$script(HTML(js_helpers)),
sidebarLayout(
sidebarPanel(
),
mainPanel(
htmltools::tags$button(
"Is this open solo?",
onclick = "is_solo();"
)
)
)
)
server <- function(input, output) {
}
shinyApp(ui = ui, server = server)