It is possible to check in browser's navigator.userAgent
the operation system of the user. I know we can't rely on browser's user agent because it can be spoofed, but we need it for a statistics purpose only. For Windows
environments, value Windows NT 6.3
stands for Win 8.1, Windows NT 6.2
for Win 8, Windows NT 6.1
for Win 7 and so on. Could anyone advise what value does Windows 10 put in user agent?
Thank you in advance.
A user-agent is an HTTP request header string identifying browsers, applications, or operating systems that connect to the server. Not only browsers have user-agents, but also bots, crawlers such as search engines Googlebot, Google AdSense, etc.
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.
The user-agent string of the browser is accessed using the navigator. userAgent property and then stored in a variable. The presence of the strings of a browser in this user-agent string is detected one by one. Detecting the Chrome browser: The user-agent of the Chrome browser is “Chrome”.
# Chrome for Android Chrome for Android reports its UA in the following formats, depending on whether the device is a phone or a tablet. If you are parsing user agent strings using regular expressions, the following can be used to check against Chrome on Android phones and tablets: Phone pattern: 'Android' + 'Chrome/[.
@NulledPointer has pointed out that the IE user agent will contain Windows NT 10.0. This is true as of the November 2014 CTP of Windows 10. That particular CTP introduces IE Edge Mode, which will be the only operating mode available for the release version of Windows 10. Here is a sample user agent string from @NulledPointer's link:
Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With