Introduction to browser User-Agent

Source: Internet
Author: User

The user agent is used to indicate the identity of the browsing user, so that web developers can know the information of the access terminal. Send different display content based on different terminals. For example, the desktop and mobile versions send different webpage content to adapt to the differences between the screen and the operating system (that is, the understanding of responsive web pages ), or because different browsers support different standards, the purpose of doing so is to avoid functionality not supported by the browser and to get a better user experience.

As the browser market becomes increasingly competitive, Web developers will design a website with the best user experience based on the most popular browsers. This is a blow to other browsers, so they will soon improve their own defects, hoping to support these users to experience good web effects.

The Mozilla Firefox browser initially sets its own user proxy string, such as "Mozilla/1.0 (Windows NT 6.1; RV: 2.0.1) Gecko/20100101 Firefox/4.0.1 ", this string indicates that this is a Firefox browser for Windows that uses the gecko engine (Firefox kernel.

Later, ie found that the web page displayed by herself was not rich in Firefox, so it released a User Agent compatible with Firefox. Let's take a look at the user agent settings of IE and you will be able to understand -- "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0 )". What is the meaning of this string? It indicates that this is a Windows IE7 browser that can be compatible with Mozilla. In this way, the content provider will send the content sent to the Firefox browser to the IE browser based on the "Mozilla" string information, because in their view, these are all "Mozilla" browsers.

Since then, the browser market has become increasingly competitive in order to be compatible with each other. Apple's Safari browser also has a similar proxy, but the browser has added additional information such as applewebkit and safari. With its popularity (especially in the mobile field ), in addition to Mozilla, chrome and other browsers also add the Flag Information of the Safari browser, resulting in a longer and longer user proxy string.

Let's take a look at Chrome's User-Agent

650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M00/38/F9/wKiom1O1GETy0LAdAAXiQYxZfME654.jpg "Title =" xchrome-agent.png.pagespeed.ic.9wLhplVgPv.png "alt =" wkiom1o1gety0ladaaxiqyxzfme654.jpg "/> here we can see that Chrome is the release of Mac, compatible with Mozilla and Safari, the kernel is compatible with applewebkit and Gecko

User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) applewebkit/537.36 (khtml, like gecko) Chrome/35.0.1916.153 Safari/537.36

Let's take a look at Firefox's User-Agent.

650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M00/38/F8/wKioL1O1GKOROEKJAAbUEHvaIPc893.jpg "Title =" xfirefox-agent.png.pagespeed.ic.C5-rQ1mr38.png "alt =" wkiol1o1gkoroekjaabuehvaipc893.jpg "/> You Can See That Firefox is the release of the Windows platform, the kernel is Firefox's own kernel Gecko

User-Agent: Mozilla/5.0 (Windows NT 6.1; wow64; RV: 30.0) Gecko/20100101 Firefox/30.0

Take a look at Safari on Mac

650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M00/38/F9/wKioL1O1GZPy8HOGAAbf1kFgBhs046.jpg "Title =" safari-agent.png "alt =" wkiol1o1gzpy8hogaabf1kfgbhs046.jpg "/> see, compatible with Mozilla, for the release of the MAC system, use your own WebKit kernel (Apple)

User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) applewebkit/537.75.14 (khtml, like gecko) version/7.0.3 Safari/537.75.14

Finally, the User-Agent of IE

650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M02/38/F9/wKioL1O1GjWAgWXrAAaQk-exw0Q321.jpg "Title =" ie-agent.png "alt =" wKioL1O1GjWAgWXrAAaQk-exw0Q321.jpg "/> see, compatible with Mozilla, using compatible mode ie10, using their own Trident Kernel

User-Agent: Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; win64; x64; Trident/6.0)

Simulate mobile devices

Here we can simulate a mobile device to check the display effect, simulate the device, Galaxy Note II, and send a request to the server through this device.

The request header is as follows,

User-Agent: Mozilla/5.0 (Linux; U; Android 4.1; en-US; GT-N7100 build/jro03c) applewebkit/534.30 (khtml, like gecko) version/4.0 mobile safari/534.30

650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M02/38/F9/wKiom1O1GzSBP5FOAAaGo1iJf8A810.jpg "Title =" mobile-agent.png "alt =" wkiom1o1gzsbp5foaaag1ijf8a810.jpg "/>

Because the webpage has been displayed on a mobile device, a display interface with adaptive width is displayed.

All these tedious User-Agent services aim to improve the webpage content experience. From the mainstream browsers above, we can see that due to the popularity of Some browsers, many web content providers and websites need to customize the content according to the popular browsers. When later users need the same content, it can only be obtained through imitating the information of these user proxies.

Link: http://mingkr.com/browser-user-agent

Home: http://mingkr.com



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.