Why do Chrome and IE put "Mozilla 5.0" in the User-Agent they send to the server?

user605334 picture user605334 · Feb 26, 2011 · Viewed 89.4k times · Source

When I myself send many requests to the server I found it amazing that in IE if I choose opera user string that the value of user string was

User-Agent  Opera/9.80 (Windows NT 6.1; U; en) Presto/2.2.15 Version/10.00

But if I choose another browser in Internet Explorer that it puts Mozilla 5.0 in the user string first.

When I send the ajax request from Chrome that I found same thing that they put user string

Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.20 (KHTML, like Gecko) Chrome/11.0.672.2 Safari/534.20

I found that Mozilla is an organization that doesn't have anything to do with Google and Microsoft. Perhaps it was a competitor for both. Why do MSFT and Google both put Mozilla in their user agent? Is there any reason for putting Mozilla in connection string?

Why do chrome and IE both put Mozilla in the userstring when they send the request? I do not know why but is there any specific reason for that?

Answer

joatis picture joatis · Feb 26, 2011

See: user-agent-string-history

It all goes back to browser sniffing and making sure that the browsers are not blocked from getting content they can support. From the above article:

And Internet Explorer supported frames, and yet was not Mozilla, and so was not given frames. And Microsoft grew impatient, and did not wish to wait for webmasters to learn of IE and begin to send it frames, and so Internet Explorer declared that it was “Mozilla compatible” and began to impersonate Netscape, and called itself Mozilla/1.22 (compatible; MSIE 2.0; Windows 95), and Internet Explorer received frames, and all of Microsoft was happy, but webmasters were confused.