Puzzle: What is Mozilla/5.0? Why does every browser have this string in its User-Agent?

Puzzle: What is Mozilla/5.0? Why does every browser have this string in its User-Agent?

Daily short news for you
  • Manus has officially opened its doors to all users. For those who don't know, this is a reporting tool (making waves) similar to OpenAI's Deep Research. Each day, you get 300 free Credits for research. Each research session consumes Credits depending on the complexity of the request. Oh, and they seem to have a program giving away free Credits. I personally saw 2000 when I logged in.

    I tried it out and compared it with the same command I used before on Deep Research, and the content was completely different. Manus reports more like writing essays compared to OpenAI, which uses bullet points and tables.

    Oh, after signing up, you have to enter your phone number for verification; if there's an error, just wait until the next day and try again.

    » Read more
  • I just found a quite interesting website talking about the memorable milestones in the history of the global Internet: Internet Artifacts

    Just from 1977 - when the Internet was still in the lab - look how much the Internet has developed now 🫣

    » Read more
  • Just thinking that a server "hiding" behind Cloudflare is safe, but that’s not necessarily true; nothing is absolutely safe in this Internet world. I invite you to read the article CloudFlair: Bypassing Cloudflare using Internet-wide scan data to see how the author discovered the IP address of the server that used Cloudflare.

    It's quite impressive, really; no matter what, there will always be those who strive for security and, conversely, those who specialize in exploiting vulnerabilities and... blogging 🤓

    » Read more

The Issue

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.

History of the UA string

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!!!

Conclusion

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:

Premium
Hello

5 profound lessons

Every product comes with stories. The success of others is an inspiration for many to follow. 5 lessons learned have changed me forever. How about you? Click now!

Every product comes with stories. The success of others is an inspiration for many to follow. 5 lessons learned have changed me forever. How about you? Click now!

View all

Subscribe to receive new article notifications

or
* The summary newsletter is sent every 1-2 weeks, cancel anytime.

Comments (2)

Leave a comment...
Avatar
Hương Trịnh2 years ago
Bỏ UA đi thì sao mà detect đc browser nữa nhỉ? Kb có phát minh gì mới sao?
Reply
Avatar
Xuân Hoài Tống2 years ago
Mình cũng đoán là chắc có công nghệ gì đó thay thế
Avatar
Vũ Mạnh Đức2 years ago
Oh thì ra là vậy thật thú vị h mới hiểu :D
Reply
Avatar
Xuân Hoài Tống2 years ago
:D hay mà bạn