get_user_agent: Get user agent string from the browser

View source: R/get_info.R

get_user_agentR Documentation

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()

Value

User's user-agent string

See Also

detect(), get_all_info()

Examples

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)
}

daattali/shinybrowser documentation built on Aug. 21, 2024, 6:12 a.m.