String getUserAgent()

Source

String getUserAgent() {
  return window.navigator.userAgent;
}