Search notes:

Browser object model: navigator.userAgent

navigator.userAgent returns the browser's HTTP User Agent string.
This link prints the value of navigator.userAgent. The HTML of the link is this:
<!DOCTYPE html>
<!--

  https://github.com/ReneNyffenegger/Browser-Object-Model/tree/master/navigator/userAgent.html

  https://renenyffenegger.ch/development/web/js-html/userAgent.html

-->
<html>
<head>
  <meta content="text/html;charset=utf-8" http-equiv="Content-Type">
  <title>navigator.userAgent</title>
  <script type="text/JavaScript">

    function main() {
      ua = navigator.userAgent;
      document.getElementById('ua').innerHTML = ua;

      divMob = document.getElementById('isMobile');
      if (ua.match(/Mobile/)) {
        divMob.innerHTML = 'This device seems to be a <b>Mobile</b>.';
      }
      else {
        divMob.innerHTML = 'This device <b>does not</b> seem to be a Mobile.';
      }
    }

  </script>
</head>
<body onload='main()'>

  <div id='ua'></div>
  <p>
  <div id='isMobile'></div>

</body>
</html>
Github repository Browser-Object-Model, path: /navigator/userAgent.html

See also

Object model

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1758207167, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/web/browser/object-model/navigator/userAgent(77): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78