Request.getUserAgent
Request.getUserAgent() -> string
Description
Get the user agent of the client, as a Map with the keys os
, browser
, and full
.
Values for os
:
windows
mac
ios
android
linux
other
Values for browser
:
chrome
firefox
edge
ie
safari
Request.getUserAgent() /* Example: { browser: 'chrome' os: 'mac' full: 'Mozilla/5.0 (Macintosh Intel Mac OS X...' } */ $downloadLink = 'win/myapp.exe' if Request.getUserAgent().os == 'mac' { downloadLink = 'mac/myapp.dmg' }