views:

298

answers:

3

I am using the browser Firefox and IE. I have run the java script program. In that I was found both the browser code name is showed as: Mozilla. Why? The code is

 <script type="text/javascript">
 document.write("Browser CodeName: " + navigator.appCodeName);
 </script>
+4  A: 

Short answer: Because people thought that user agent detection (instead of feature (AKA object) detection) was a good idea.

Long answer: History of the browser user-agent string

David Dorward
great article. +1
Glycerine
+1  A: 

That navigator.appCodeName based on useragent string and In IE's useragent string, there is Mozilla 4.0 or something, so thats why its display Mozilla for both.

S.Mark
+1  A: 

Many years ago, developers used browser detection to reject other browsers, usually favouring Netscape Navigator (precursor to Mozilla and Firefox, also codenamed Mozilla). They tested for the string 'Mozilla' in the user agent. Internet Explorer got angsty and decided to imitate Netscape so they could join in on the fun.

Delan Azabani