I've been seeing a lot of this useragent in my logs from a webapp: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/605.1.15 (KHTML, like Gecko)
. As the user agent doesn't contain any browser name, is there a way to tell what browser and version user was using? Also, does anyone know what this user agent is? The operating system seems to be macOS X 10.13.6, but beyond that, there is no information on what the browser is.

- 1,627
- 12
- 26
2 Answers
Sadly there is no magic bullet to do what you want. You have to look up the values of the User-Agent using a list of known User-Agents. There are several resources on the web, one of which is https://deviceatlas.com/blog/list-of-user-agent-strings but you should know that you will have to keep updating your list periodically as browsers are updated and released.
For your sample and using the site above, Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) would be Mac OX X-based computer using Safari and AppleWebKit/605.1.15 (KHTML, like Gecko) would be Apple iPhone XR (which is Safari).
There are many great JavaScript libraries that have this functionality, and a great site to find links to many of them is: https://www.whatsmyua.info/ - visit the site and it will show you the parsed User-Agent information about your browser, and it will give you links to many JavaScript libraries that will parse the value.

- 1,048
- 6
- 15
-
I see. I was hoping to get a magic bullet to determine but looks like it's not possible. Thank you. – TuanDT Dec 07 '22 at 11:30
-
@TuanDT I understand, we needed to do the same thing where I work and learned that there is no magic bullet. But you can find some great libraries that are updated that will do the task for you, so at least there is a working solution :-) – Bjorg P Dec 07 '22 at 14:32
have you tried using an online user agent parser tool? there are many available, but https://51degrees.com/developers/user-agent-tester is an example. you can pop in your user agent and it'll return the browser information. in your mentioned user agent, it shows that it's a safari browser, but not what version it is unfortunately as that's missing from the string. using an online parser may help if you get any future weird user agents!
disclosure: i work for 51Degrees but often use our user agent parser myself!

- 16
- 1