abc abc - 1 year ago 76
Javascript Question

displays on mozilla as browser name when used in other browsers

Below is the code that i used to display the browser name on page load as an alert but it is displaying the browser name as mozilla when i am running in google chrome,mozilla and firefox but what i need is when using chrome it should display alert as browser name chrome and when running in firefox as browser name firefox and when running in internet explorer as browser name Ie but my below script shows only mozilla

alert("Browser Name : " + window.navigator.appCodeName);

Answer Source

you can user vendor:


but on microsoft edge and internet explorer this value will be empty.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download