I am trying to detect what browser a user is using my web app on and, interestingly, when I check the navigator
variable, it shows me some values like this -
Now I don't understand why appCodeName
is 'Mozilla' and appName
is 'Netscape'
Also, why is navigator.product
showing 'Gecko'?
Could someone decode this please?
According to the WHATWG's HTML Living Standard, navigator.appCodeName
must return Mozilla
, and navigator.appName
must return Netscape
(i.e., all modern browsers return the same values). These values are deprecated, and going forward, will be removed altogether. The only reason they are still around is for backwards compatibility; their removal could break an app that depends on them. As with other web standards, we are in a bit of a transitional phase.