1

I need for specific reasons precisely detect browser name and version. Searched here and rest of the web and most answers point to Modernizr and detecting features. That's not what I want. I want to get actual name and version.

That means:

  • if it's Edge, I need to know it's version, not it's EdgeHTML version (optional, but it would be great if I can get that data)

  • if it's let's say Vivaldi, then don't tell me it's Safari or Chrome, it's Vivaldi.

  • if it is some browser I haven't heard of and is not listed in my list that I search for in user agent, I need to know it's name (and version).

I tried with .NET with both mixture of userAgent data and HttpContext.Current.Request.Browser class (and even taking in consideration the operating system). However, it sends ambiguous data, once in a while doesn't recognize Chrome.

Possible solution can be JS/jQuery, it doesn't have to be .NET.

EDIT: Someone said that this is possible duplication: How can you detect the version of a browser? It is not, because I tested it against Vivaldi

(user agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.189 Safari/537.36 Vivaldi/1.95.1077.60)

and it outputted Chrome 64, so it doesn't meet my criteria stated above

Dalibor
  • 1,430
  • 18
  • 42
  • Usually I use `Navigator` API for getting browser information, I make ajax call to server with required data from `Navigator` and in server you can read those. https://developer.mozilla.org/en-US/docs/Web/API/Navigator – nerding_it Aug 17 '18 at 07:52
  • i don't think modernizr supports this [feature](https://github.com/Modernizr/Modernizr/issues/203) – IteratioN7T Aug 17 '18 at 08:06
  • Possible duplicate of [How can you detect the version of a browser?](https://stackoverflow.com/questions/5916900/how-can-you-detect-the-version-of-a-browser) – IteratioN7T Aug 17 '18 at 08:11
  • Show https://stackoverflow.com/questions/32435511/why-using-window-navigator-useragent-to-retrieve-the-browser-explorer-11-is-reco – Bhautik Chudasama Aug 17 '18 at 08:21
  • @IteratioN7T No, it's not a duplicate, see my edit above – Dalibor Aug 18 '18 at 10:53

2 Answers2

1

Since the navigator.userAgent string can be a bit funky at times, I typically rely on a library like useragent to parse it for me.

If you're not looking to add another dependency, you could at least use that as a jumping-off point for understanding how to better parse the userAgent string.

Sean D
  • 134
  • 3
1

try this one

jQuery.browser and jQuery.browser.version

the full answer is here: How to get browser's name client side?

hope it helps ;)

Mahran Sarko
  • 62
  • 3
  • 10