A browser sends User Agent to web server in a HTTP header whenever you connect to a website with the browser, rendering engine and operating system identifiable information, in return web server serves different pages to different browsers and different Operating systems.

Sometimes, the need arises to know user agent strings of browser you’re running, that could be Microsoft Edge, Firefox, Google Chrome or Internet Explorer. Do you know by running a simple and a single JavaScript line of code you can know User Agent of popular browsers easily.

Getting UA Strings of Microsof Edge, Internet Explorer, Firefox and Chrome browsers with a JavaScript command

I. In  Edge browser:  Visit any website, press F12 to open Developer tools or click on More actions and select ‘F12 Developer Tools’

Paste the below code and press enter

javascript:alert(navigator.userAgent)

Edge browser User Agent String

II. In Internet Explorer: Press F12 to open Developer Tools

Click on Console, paste the command and press enter to run.

Internet explorer User agent string

III. In Chrome, Press Ctrl+Shift+I to open developer tools, or you can open DT from menu > More Tools > Developer Tools

Press Ctrl+V and enter.

Google Chrome User Agent String

IV. In Firefox, open Web Console by using Ctrl+Shift+k shortcut or click on menu > Developer, select Web Console

Type javascript,alert(navigation.userAgent)  -(pasting is not allowed) and press enter to run

Firefox User Agent string