Learn R Programming

shinybrowser (version 1.0.0)

get_user_agent: Get user agent string from the browser

Description

This function exposes the user agent that is reported by the browser, but it should only be used for troubleshooting purposes. The value is reactive, therefore it must be accessed inside a reactive context (such as an observe or reactive). {shinybrowser} must be initialized with a call to detect() in the app's ui.

Usage

get_user_agent()

Arguments

Value

User's user-agent string

See Also

detect(), get_all_info()

Examples

Run this code
# NOT RUN {
if (interactive()) {
  library(shiny)

  ui <- fluidPage(
    shinybrowser::detect(),
    "Your user agent:",
    textOutput("ua_info")
  )
  server <- function(input, output, session) {
    output$ua_info <- renderText({
      shinybrowser::get_user_agent()
    })
  }
  shinyApp(ui, server)
}
# }

Run the code above in your browser using DataLab