One fine day while researching the User-Agent (UA) string of popular web browsers, I noticed a common pattern among them. Apart from the unique strings that identify the browsers like Chrome/43.0.2357.65, Firefox/40.0, MSIE 9.0, almost all of them had a string called Mozilla/5.0 or sometimes WebKit. What are these strings and why do they appear in the User-Agent? I delved into the history and discovered some interesting facts about this phenomenon.
NCSA Mosaic was the world's first web browser, and when it was released, it identified itself as NCSA_Mosaic/2.0 (Windows 3.1) through the UA string that we still know today. Mosaic was the first browser to display images along with text :D.
Then a new web browser called "Mozilla" emerged, which stood for "Mosaic Killer." However, they realized that the name wasn't very interesting, so Mozilla was changed to Netscape, and Netscape identified itself as Mozilla/1.0 (Win3.1).
Netscape introduced frames, which became popular among the Internet community, but Mosaic did not support frames. Therefore, developers had to check the browser type to send frames. If the browser was Netscape, frames were sent; otherwise, they weren't :D.
Netscape then mocked Microsoft (MS), calling Windows "poorly debugged device drivers," which made Microsoft angry. As a result, Microsoft created its own web browser called Internet Explorer (IE) with the hope of becoming a "Netscape Killer."
Of course, IE had to support frames, but it wasn't Mozilla, so it didn't provide frames by default for web administrators. Microsoft was impatient and didn't want to wait for web admins to figure out IE. Therefore, IE declared itself "Mozilla-compatible" and started impersonating Netscape, identifying itself as Mozilla/1.22 (compatible; MSIE 2.0; Windows 95). Immediately, IE received frames, which pleased MS but confused web administrators. MS bundled IE with Windows, making it popular and better than Netscape. The first browser war erupted everywhere.
As predicted by MS, Netscape was defeated. However, Netscape was reborn as Mozilla, and Mozilla developed Gecko, identifying itself as Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv: 1.1) Gecko/20020826. Gecko was the best rendering engine at the time.
Mozilla further evolved into Firefox and identified itself as Mozilla/5.0 (Windows; U; Windows NT 5.1; sv-SE; rv: 1.7.5) Gecko/20041108 Firefox/1.0. Firefox excelled as a web browser. Gecko began to flourish, and other browsers were created using its code. They called themselves names like Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv: 1.7.2) Gecko/20040825 Camino/0.8.1 and Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv: 1.8.1.8) Gecko/20071008 SeaMonkey/1.0. They all pretended to be Mozilla and were powered by Gecko.
Gecko was an excellent rendering engine, while IE was the opposite, causing web administrators to scramble to differentiate code for different browsers. Other browsers struggled to compete with Gecko.
Linux enthusiasts noticed this and couldn't sit still, so they created Konqueror with the KHTML engine, considering it "as good as" Gecko, but it wasn't Gecko, so it didn't return Gecko code. Therefore, Konqueror declared itself "KHTML-compatible" to obtain Gecko code and identified itself as Mozilla/5.0 (compatible; Konqueror/3.2; FreeBSD) (KHTML, like Gecko).
Then came Opera, saying, "We should let users decide which browser they prefer." So Opera allowed users to choose UA strings like Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; vi) Opera 9.51 or Mozilla/5.0 (Windows NT 6.0; U; en; rv: 1.8.1) Gecko/20061208 Firefox/2.0.0 Opera 9.51 or Opera/9.51 (Windows NT 5.1; U; en).
Apple built Safari using KHTML but added many features, so the project split and called it WebKit. However, they wanted to use code written for KHTML. Therefore, Safari identified itself as Mozilla/5.0 (Macintosh; U; PPC Mac OS X; de-de) AppleWebKit/85.7 (KHTML, like Gecko) Safari/85.5.
Once again, MS brought back Internet Explorer with a new version. They called it Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0) and displayed Gecko code very well, but only when web administrators commanded it to do so.
Finally, Google built Chrome using WebKit just like Safari, and of course, Chrome wanted websites built for Safari, so it pretended to be Safari. Chrome identified itself as Mozilla/5.0 (Windows; U; Windows NT 5.1; vi-US) AppleWebKit/525.13 (KHTML, like Gecko) Chrome/0.2.149.27 Safari/525.13.
Subsequently, browsers, regardless of how they were born, "tried" to race to become "like" the browsers already on the Internet market.
So far, let's summarize what the browser war has left us with. Chrome used WebKit and pretended to be Safari, while WebKit pretended to be KHTML, and KHTML pretended to be Gecko. In the end, all browsers pretend to be Mozilla!!!
The browser community has gone through many changes, resulting in a chaotic UA string as we see today. In 2020, Chrome announced that it would remove the UA string from the browser, but it seems that it hasn't been fully implemented yet. In reality, developers are still writing code to be compatible with Mozilla/5.0 :D.
References:
Hello, my name is Hoai - a developer who tells stories through writing ✍️ and creating products 🚀. With many years of programming experience, I have contributed to various products that bring value to users at my workplace as well as to myself. My hobbies include reading, writing, and researching... I created this blog with the mission of delivering quality articles to the readers of 2coffee.dev.Follow me through these channels LinkedIn, Facebook, Instagram, Telegram.
Comments (2)