This is a simple tutorial with javascript to see the browser user agent.
About user agent:
– user agents are unique to every visitor on the web;
– everyone that is browsing the web right now has a user agent;
– browsers are an example of a user agent;
– other tools can act as agents;
– the user agent has identified itself to the web server with a process called content negotiation;
– it’s possible to send a fake user agent, a process known as “spoofing.”
Now about how to see the user agent with browser.
Let’s start with create your folder and add an index.html file.
Add also into this folder another folder named js.
Into js folder add a file named index.js file.
Into index.html file add this source code:

Into index.js file add this source code:

When you open the index.html file with your browser you can see your browser user agent.
For example, the result of this script into my browser is:

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Translate »