Skip to content

Knowledge Literacy - Why do all browsers' User-Agent (UA) strings start with 'Mozilla'

Original link: https://www.itylq.com/user-agent-start-with-mozilla.html

Release date: 2023-04-16 Migration time: 2026-03-21

Friends who are familiar with front-end design, development and testing should often find that user-agent in request headers is a long string starting with "Mozilla" at work. //At present, the UA string of most browsers should be Mozilla/5.0(...).

For example, the default user-agent string of the Firefox browser I am using at the moment is:

Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/111.0)

Literally understood, "Mozilla" should represent the Firefox browser, so why do the current mainstream PC/mobile browsers, such as Chrome, Edge, IE, Opera, Safari, etc., and even WeChat applet web pages use Mozilla/5.0(...) as the user-agent? To explain this problem, we have to mention the history of browser development.

The earliest popular browser was NCSA Mosaic, or Mosaic for short. It was published by the National Center for Supercomputing Applications (NCSA) at the University of Illinois at Urbana-Champaign in 1993. It was the first web browser in the history of the Internet to be widely used and capable of displaying images. In the NCSA Mosaic software, it calls itself in the request header: "NCSA_Mosaic/2.0 (Windows 3.1)". This is the earliest prototype of user-agent.

In 1994, Marc Andreessen, the central figure in the Mosaic development team, went solo and established Netscape Communications Corporation in California. The University of Illinois transferred all Mosaic-related technologies and copyrights to Spyglass Entertainment. In 1995, Microsoft bought the Mosaic license from Spyglass Entertainment and developed Internet Explorer based on it, thereby entering the browser market. Later, Netscape and Microsoft launched a fierce competition in the browser field, which was known as the "Browser War" in history.

Let's talk about Netscape Communications. Because it is in a competitive relationship with Mosaic and has a very unhappy dispute with the University of Illinois and Microsoft over copyright issues, Netscape Communications launched the official version of browser 1.0 and named it Netscape Navigator. For the purpose of disgusting competitors, it called itself Mozilla/1.0 (win3.1) when describing itself in its request header. Mozilla = Mosaic Killer, that is, Mosaic Killer.

At that time, the Netscape Navigator browser supported frames, but Mosaic did not. The Netscape Navigator browser had a certain lead in user experience. Therefore, the User Agent sniffing technology came into being. If the website backend detects the Mozilla logo in the request header, it will know that the user is using the Netscape Navigator browser and send the frame. If not, it will not send it. This is commonly known as "watching others' dishes".

Later, Microsoft developed IE based on Mosaic. Although IE also supported frames, because it was not Mozilla, websites did not send frames to it. As a latecomer, in order to seize the market of Netscape's Netscape browser, Microsoft did not wait patiently for major websites to modify user agent sniffing (User Agent sniffing) to support IE. Instead, it claimed that it was compatible with Mozilla. Therefore, IE pretended to be Netscape and called itself:

Mozilla/1.22 (compatible; MSIE 2.0; Windows 95)

This deceives the website into receiving the frame sent by the website. Looking at it now, Microsoft's operation is quite explosive, and it is really blinding.

Needless to say, the outcome of the "browser wars" was that Netscape failed due to IE's forced binding to Windows systems everywhere.

With the Tianxiu operation of Microsoft IE browser, in order to allow user agent sniffing (User Agent sniffing) to provide better services for itself, all major operating systems and browsers have conventionally claimed that they are compatible with Mozilla. For example, the rendering engine used by the browser Konqueror on Linux is KHTM, which claims in the user-agent that it is:

Mozilla/5.0 (compatible; Konqueror/3.2; FreeBSD) (KHTML, like Gecko)

Opera provides the option to claim whichever browser they want.

Apple later created a fork of KHTML called WebKit, calling itself:

Mozilla/5.0 (Macintosh; U; PPC Mac OS X; de-de) AppleWebKit/85.7 (KHTML, like Gecko) Safari/85.5

This is why almost all browsers’ user-agent strings start with “Mozilla”.


Attachment: Commonly used USER_AGENT (PC, mobile device, WeChat under Android system, WeChat User Agent under IOS system)

PC version:

Browser User-agent
safari 5.1 – MAC Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_8; en-us) AppleWebKit/534.50 (KHTML, like Gecko) Version/5.1 Safari/534.50
safari 5.1 – Windows Mozilla/5.0 (Windows; U; Windows NT 6.1; en-us) AppleWebKit/534.50 (KHTML, like Gecko) Version/5.1 Safari/534.50
IE 9.0 Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0;)
IE 8.0 Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0)
IE 7.0 Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)
IE 6.0 Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
Firefox 4.0.1 – MAC Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv,2.0.1) Gecko/20100101 Firefox/4.0.1
Firefox 4.0.1 – Windows Mozilla/5.0 (Windows NT 6.1; rv,2.0.1) Gecko/20100101 Firefox/4.0.1
Opera 11.11 – MAC Opera/9.80 (Macintosh; Intel Mac OS X 10.6.8; U; en) Presto/2.8.131 Version/11.11
Opera 11.11 – Windows Opera/9.80 (Windows NT 6.1; U; en) Presto/2.8.131 Version/11.11
Chrome 17.0 – MAC Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_0) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.56 Safari/535.11
Maxthon Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Maxthon 2.0)
Tencent TT Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; TencentTraveler 4.0)
The World 2.x Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)
The World 3.x Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; The World)
Sogou Browser 1.x Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; SE 2.X MetaSr 1.0; SE 2.X MetaSr 1.0; .NET CLR 2.0.50727; SE 2.X MetaSr 1.0)
360 Browser Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; 360SE)
Avant Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Avant Browser)
Green Browser Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)

Mobile device version:

Browser User-agent
safari iOS 4.33 – iPhone Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_3_3 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8J2 Safari/6533.18.5
safari iOS 4.33 – iPod Touch Mozilla/5.0 (iPod; U; CPU iPhone OS 4_3_3 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8J2 Safari/6533.18.5
safari iOS 4.33 – iPad Mozilla/5.0 (iPad; U; CPU OS 4_3_3 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8J2 Safari/6533.18.5
Android N1 Mozilla/5.0 (Linux; U; Android 2.3.7; en-us; Nexus One Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1
Android QQ Browser For android MQQBrowser/26 Mozilla/5.0 (Linux; U; Android 2.3.7; zh-cn; MB200 Build/GRJ22; CyanogenMod-7) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1
Android Opera Mobile Opera/9.80 (Android 2.3.4; Linux; Opera Mobi/build-1107180945; U; en-GB) Presto/2.8.149 Version/11.10
Android Pad Moto Xoom Mozilla/5.0 (Linux; U; Android 3.0; en-us; Xoom Build/HRI39) AppleWebKit/534.13 (KHTML, like Gecko) Version/4.0 Safari/534.13
BlackBerry Mozilla/5.0 (BlackBerry; U; BlackBerry 9800; en) AppleWebKit/534.1+ (KHTML, like Gecko) Version/6.0.0.337 Mobile Safari/534.1+
UC Opera Mozilla/4.0 (compatible; MSIE 6.0; ) Opera/UCWEB7.0.2.37/28/999

WeChat UA under Android system:

Browser User-agent
Xiaomi on WIFI Mozilla/5.0 (Linux; Android 7.1.1; MI 6 Build/NMF26X; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/57.0.2987.132 MQQBrowser/6.2 TBS/043807 Mobile Safari/537.36 MicroMessenger/6.6.1.1220(0x26060135) NetType/WIFI Language/zh_CN
VIVO X6S WIFI Mozilla/5.0 (Linux; Android 5.1.1; vivo MicroMessenger/6.6.1.1220(0x26060135) NetType/WIFI Language/zh_CN
HUAWEI TAG-AL00 4G Mozilla/5.0 (Linux; Android 5.1; HUAWEI TAG-AL00 Build/HUAWEITAG-AL00; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/53.0.2785.49 Mobile MQQBrowser/6.2 TBS/043622 Safari/537.36 MicroMessenger/6.6.1.1220(0x26060135) NetType/4G Language/zh_CN
Mini Program Mozilla/5.0 (Linux; Android 7.1.1; MI 6 Build/NMF26X; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/57.0.2987.132 MQQBrowser/6.2 TBS/043807 Mobile Safari/537.36 MicroMessenger/6.6.1.1220(0x26060135) NetType/4G Language/zh_CN MicroMessenger/6.6.1.1220(0x26060135) NetType/4G Language/zh_CN miniProgram

WeChat UA under IOS system:

Browser User-agent
iphoneX WIFI Mozilla/5.0 (iphone x Build/MXB48T; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/53.0.2785.49 Mobile MQQBrowser/6.2 TBS/043632 Safari/537.36 MicroMessenger/6.6.1.1220(0x26060135) NetType/WIFI Language/zh_CN

This article was moved from WordPress to MkDocs