V
V
Vladislav Khvostov2016-04-07 16:39:35
JavaScript
Vladislav Khvostov, 2016-04-07 16:39:35

Why does the javascript navigation object return so many browsers?

I'm trying to find out the user's browser. I display the value of navigator.userAgent, I get the string - "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.91 YaBrowser/16.4.0.6174 (beta) Safari/537.36"
Instead of the expected YaBrowser/ 16.4.0.6174 (beta), how to understand which browser is actually used?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
D
Defman21, 2016-04-07
@Defman21

webaim.org/blog/user-agent-string-history

A
Alexander Litvinenko, 2016-04-07
@edli007

These are priorities,
like I "Mozilla/5.0 (Windows NT 6.3; WOW64)"
don't you know that? then I "AppleWebKit/537.36 (KHTML, like Gecko)"
don't you know that? then I "Chrome/49.0.2623.91"
do not know this? then I "YaBrowser/16.4.0.6174 (beta)"
do not know this? then I "Safari / 537.36"
Yandex browser uses the engine of someone else's browser, because it works there - it also works in yab. But most programs have not heard anything about yab, so he presents himself to them as "I'm Mozilla / 5.0 (Windows NT 6.3; WOW64)"

A
Andrey Popov, 2016-04-07
@Nord001

I don't have YaBrowser so I'm not sure but theoretically

navigator.appCodeName
should help you

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question