Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Example Analysis of browser User-Agent

2025-04-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

Browser User-Agent example analysis, in view of this problem, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible way.

1. Basic knowledge:

User-Agent of Http Header

User Agent, which is called user agent in Chinese, is a part of Http protocol and a part of header domain. User Agent is also referred to as UA. It is a special string header, is a kind of access to the website to provide you with the browser type and version, operating system and version, browser kernel, and other information. Through this logo, the websites visited by users can display different typesetting to provide users with a better experience or do information statistics; for example, mobile access to Google is not the same as computer access, which is judged by Google based on the UA of visitors. UA can be camouflaged.

The standard format of the browser's UA string: browser ID (operating system ID; encryption level ID; browser language) rendering engine ID version information. But each browser is different.

String description:

1. Browser logo

For compatibility and promotion purposes, many browsers have the same logo, so the browser logo does not indicate the true version of the browser, and the real version information can be found at the end of the UA string.

2. Operating system identification

3. Encryption level identification

N: indicates no secure encryption

I: indicates weak security encryption

U: indicates strong security encryption

4. Browser language

The language specified in preferences > General > language

5. Rendering engine

The mainstream rendering engines used by display browsers are: Gecko, WebKit, KHTML, Presto, Trident, Tasman, etc., in the format of: rendering engine / version information

6. Version information

Displays the real version information of the browser in the format: browser / version information

Note:

1. In the setting of advertising orientation, both browser orientation and operating system orientation are directed against the information in User-Agent.

2. For more User-Agent information, please refer to the history of User-agent strings

Details of browser User-Agent

PC side:

Safari 5.1-MAC

User-Agent: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

User-Agent: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

User-Agent:Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0

IE 8.0

User-Agent:Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0)

IE 7.0

User-Agent:Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)

IE 6.0

User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)

Firefox 4.0.1-MAC

User-Agent: 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

User-Agent:Mozilla/5.0 (Windows NT 6.1; rv:2.0.1) Gecko/20100101 Firefox/4.0.1

Opera 11.11-MAC

User-Agent:Opera/9.80 (Macintosh; Intel Mac OS X 10.6.8; U; en) Presto/2.8.131 Version/11.11

Opera 11.11-Windows

User-Agent:Opera/9.80 (Windows NT 6.1; U; en) Presto/2.8.131 Version/11.11

Chrome 17.0-MAC

User-Agent: 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

Ao you (Maxthon)

User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Maxthon 2.0)

Tencent TT

User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; TencentTraveler 4.0)

Window of the World (The World) 2.x

User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)

Window of the World (The World) 3.x

User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; The World)

Sogou browser 1.x

User-Agent: 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

User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; 360SE)

Avant

User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Avant Browser)

Green Browser

User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)

Mobile device side:

Safari iOS 4.33-iPhone

User-Agent: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

User-Agent: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

User-Agent: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

User-Agent: 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

User-Agent: 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

User-Agent: 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

User-Agent: 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

User-Agent: Mozilla/5.0 (BlackBerry; U; BlackBerry 9800; en) AppleWebKit/534.1+ (KHTML, like Gecko) Version/6.0.0.337 Mobile Safari/534.1+

WebOS HP Touchpad

User-Agent: Mozilla/5.0 (hp-tablet; Linux; hpwOS/3.0.0; U; en-US) AppleWebKit/534.6 (KHTML, like Gecko) wOSBrowser/233.70 Safari/534.6 TouchPad/1.0

Nokia N97

User-Agent: Mozilla/5.0 (SymbianOS/9.4; Series60/5.0 NokiaN97-1 Compact 20.0.019; Profile/MIDP-2.1 Configuration/CLDC-1.1) AppleWebKit/525 (KHTML, like Gecko) BrowserNG/7.1.18124

Windows Phone Mango

User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows Phone OS 7.5; Trident/5.0; IEMobile/9.0; HTC; Titan)

UC none

User-Agent: UCWEB7.0.2.37/28/999

UC standard

User-Agent: NOKIA5700/ UCWEB7.0.2.37/28/999

UCOpenwave

User-Agent: Openwave/ UCWEB7.0.2.37/28/999

UC Opera

User-Agent: Mozilla/4.0 (compatible; MSIE 6.0;) Opera/UCWEB7.0.2.37/28/999

Second, browser identification

1. IE browser (take IE 9.0 as an example)

PC side: User-Agent:Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)

Mobile devices: User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows Phone OS 7.5; Trident/5.0; IEMobile/9.0; HTC; Titan)

Since roaming, window of the World, 360 browsers, Tencent browsers and Sogou browsers, Avant and Green Browser all use the kernel of IE, the standard of IE browser judgment is the "MSIE" field, and the number after the MSIE field is the version number. But at the same time, it also needs to decide that it does not include "Maxthon", "The world", "360SE", "TencentTraveler", "SE", "Avant" and other fields (Green Browser is not clearly identified). Mobile devices also need to determine the IEMobile+ version number.

2. 360 browser

PC side: User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; InfoPath.2; .NET 4.0C; .NET 4.0E; .NET CLR 2.0.50727; 360SE)

Mobile device: none for now

The standard of the browser is the "360SE" field, and there is no version to indicate it.

3. Sogou browser

PC side: User-Agent: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)

Mobile device: none for now

The judging criteria of Sogou browser are "SE" and "MetaSr" fields, and the version number is the number after SE.

4 、 Chrome

PC side: 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

Mobile device: User-Agent: Mozilla/5.0 (Linux; U; Android 2.2.1; zh-cn; HTC_Wildfire_A3333 Build/FRG83D) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1

The chrome browser on the PC side is judged by the chrome field, and the number after the chrome is the version number; the chrome browser on the mobile side judges the "android", "linux", "mobile safari" and other fields, and the number after the version is the version number.

5 、 Safari

PC side: User-Agent: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

Mobile device: User-Agent: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

Because Chrome and Nokia's Series 60 browser also use WebKit kernel, the judgment of Safari browser must be: include safari field, do not contain chrome and other information, and the number after "version/" is the version number. The one that contains the Mobile field under the above conditions is the Safari browser on the mobile device.

6. Tencent browser

PC side: User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; TencentTraveler 4.0; .NET CLR 2.0.50727)

Mobile device: User-Agent: 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

The criterion of Tencent browser is "TencentTraveler" or "QQBrowser", and the number after TencentTraveler or QQBrowser is the version number.

7 、 Firefox

PC side: User-Agent:Mozilla/5.0 (Windows NT 6.1; rv:2.0.1) Gecko/20100101 Firefox/4.0.1

Mobile device: User-Agent: Mozilla/5.0 (Androdi; Linux armv7l; rv:5.0) Gecko/ Firefox/5.0 fennec/5.0

The criterion of Firefox is the Firefox field, and the number after firefox is the version number.

8 、 The world

PC side: User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; The World)

Mobile device: none for now

Theworld browsers are judged by the "Theworld" field, which does not indicate the version number.

It is important to note that there is no field for "The world" in the User-Agent version of The world 2.x.

9. Travel

PC side: User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Maxthon 2.0)

Mobile device: none for now

The criterion for browsing the browser is "Maxthon", and the number after Maxthon is the version number.

10 、 Opera

PC side: User-Agent:Opera/9.80 (Windows NT 6.1; U; en) Presto/2.8.131 Version/11.11

Mobile device: User-Agent: Opera/9.80 (Android 2.3.4; Linux; Opera mobi/adr-1107051709; U; zh-cn) Presto/2.8.149 Version/11.10

Opera browsers are judged by the opera field, and the number after the opera field is the version number.

11. UC browser

UC Web can be browsed in a variety of modes. The corresponding User-Agent is:

UC none

User-Agent: UCWEB7.0.2.37/28/999

UC standard

User-Agent: NOKIA5700/ UCWEB7.0.2.37/28/999

UCOpenwave

User-Agent: Openwave/ UCWEB7.0.2.37/28/999

UC Opera

User-Agent: Mozilla/4.0 (compatible; MSIE 6.0;) Opera/UCWEB7.0.2.37/28/999

UC browsers are judged by the "UCWEB" field, and the number after UCWEB is the version number.

Operating system orientation

The operating system orientation depends on the User-Agent in the http header information transmitted by each browser when the page is opened. For a description of User-Agent, see Http header's User-Agent.

For more information about User-Agent, see the details of the browser User-Agent.

Let's learn how to identify different operating systems in User-Agent.

PC end

Mobile terminal

This is the answer to the sample analysis question about the browser User-Agent. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel for more related knowledge.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report