词条 | User agent |
释义 |
In computing, a user agent is software (a software agent) that is acting on behalf of a user. One common use of the term refers to a web browser that "retrieves, renders and facilitates end user interaction with Web content".[1] There are other uses of the term "user agent". For example, an email reader is a mail user agent. In many cases, a user agent acts as a client in a network protocol used in communications within a client–server distributed computing system. In particular, the Hypertext Transfer Protocol (HTTP) identifies the client software originating the request, using a user-agent header, even when the client is not operated by a user. The Session Initiation Protocol (SIP) protocol (based on HTTP) followed this usage. In the SIP, the term user agent refers to both end points of a communications session.[2] ==User agent identification== When a software agent operates in a network protocol, it often identifies itself, its application type, operating system, software vendor, or software revision, by submitting a characteristic identification string to its operating peer. In HTTP,[3] SIP,[2] and NNTP[4] protocols, this identification is transmitted in a header field User-Agent. Bots, such as Web crawlers, often also include a URL and/or e-mail address so that the Webmaster can contact the operator of the bot. Use in HTTPIn HTTP, the User-Agent string is often used for content negotiation, where the origin server selects suitable content or operating parameters for the response. For example, the User-Agent string might be used by a web server to choose variants based on the known capabilities of a particular version of client software. The concept of content tailoring is built into the HTTP standard in [https://tools.ietf.org/html/rfc1945#page-46 RFC 1945] "for the sake of tailoring responses to avoid particular user agent limitations.” The User-Agent string is one of the criteria by which Web crawlers may be excluded from accessing certain parts of a website using the Robots Exclusion Standard (robots.txt file). As with many other HTTP request headers, the information in the "User-Agent" string contributes to the information that the client sends to the server, since the string can vary considerably from user to user.[5] Format for human-operated web browsersThe User-Agent string format is currently specified by section 5.5.3 of HTTP/1.1 Semantics and Content. The format of the User-Agent string in HTTP is a list of product tokens (keywords) with optional comments. For example, if a user's product were called WikiBrowser, their user agent string might be WikiBrowser/1.0 Gecko/1.0. The "most important" product component is listed first. The parts of this string are as follows:
During the first browser war, many web servers were configured to only send web pages that required advanced features, including frames, to clients that were identified as some version of Mozilla.[6] Other browsers were considered to be older products such as Mosaic, Cello, or Samba, and would be sent a bare bones HTML document. For this reason, most Web browsers use a User-Agent string value as follows: Mozilla/[version] ([system and browser information]) [platform] ([platform details]) [extensions]. For example, Safari on the iPad has used the following: The components of this string are as follows:
Before migrating to the Chromium code base, Opera was the most widely used web browser that did not have the User-Agent string with "Mozilla" (instead beginning it with "Opera"). Since July 15, 2013,[7] Opera's User-Agent string begins with "Mozilla/5.0" and, to avoid encountering legacy server rules, no longer includes the word "Opera" (instead using the string "OPR" to denote the Opera version). Format for automated agents (bots)Automated web crawling tools can use a simplified form, where an important field is contact information in case of problems. By convention the word "bot" is included in the name of the agent{{citation needed|date=November 2016}}. For example: Automated agents are expected to follow rules in a special file called "robots.txt". ===User agent spoofing=== The popularity of various Web browser products has varied throughout the Web's history, and this has influenced the design of websites in such a way that websites are sometimes designed to work well only with particular browsers, rather than according to uniform standards by the World Wide Web Consortium (W3C) or the Internet Engineering Task Force (IETF). Websites often include code to detect browser version to adjust the page design sent according to the user agent string received. This may mean that less-popular browsers are not sent complex content (even though they might be able to deal with it correctly) or, in extreme cases, refused all content.[8] Thus, various browsers have a feature to cloak or spoof their identification to force certain server-side content. For example, the Android browser identifies itself as Safari (among other things) in order to aid compatibility.[9][10] Other HTTP client programs, like download managers and offline browsers, often have the ability to change the user agent string. Spam bots and Web scrapers often use fake user agents. A result of user agent spoofing may be that collected statistics of Web browser usage are inaccurate. User agent sniffing{{main article|Browser sniffing}}The term user agent sniffing refers to the practice of websites showing different content when viewed with a certain user agent. On the Internet, this will result in a different site being shown when browsing the page with a specific browser. One example of this is Microsoft Exchange Server 2003's Outlook Web Access feature. When viewed with Internet Explorer 6 or newer, more functionality is displayed compared to the same page in any other browsers. User agent sniffing is now considered poor practice, since it encourages browser-specific design and penalizes new browsers with unrecognized user agent identifications. Instead, the W3C recommends creating HTML markup that is standard,[11] allowing correct rendering in as many browsers as possible, and to test for specific browser features rather than particular browser versions or brands.[12] Websites specifically targeted towards mobile phones, like NTT DoCoMo's I-Mode or Vodafone's Vodafone Live! portals, often rely heavily on user agent sniffing, since mobile browsers often differ greatly from each other. Many developments in mobile browsing have been made in the last few years,{{When|date=May 2009}} while many older phones that do not possess these new technologies are still heavily used. Therefore, mobile Web portals will often generate completely different markup code depending on the mobile phone used to browse them. These differences can be small, e.g., resizing of certain images to fit smaller screens, or quite extensive, e.g., rendering of the page in WML instead of XHTML. Encryption strength notationsWeb browsers created in the United States, such as Netscape Navigator and Internet Explorer, previously used the letters U, I, and N to specify the encryption strength in the user agent string. Until 1996, when the United States government disallowed encryption with keys longer than 40 bits to be exported, vendors shipped various browser versions with different encryption strengths. "U" stands for "USA" (for the version with 128-bit encryption), "I" stands for "International"{{snd}} the browser has 40-bit encryption and can be used anywhere in the world{{snd}} and "N" stands (de facto) for "None" (no encryption).[13] Following the lifting of export restrictions, most vendors supported 256-bit encryption. See also
References1. ^{{cite web|url=https://www.w3.org/WAI/UA/work/wiki/Definition_of_User_Agent |title=W3C Definition of User Agent |publisher=www.w3.org |date=16 June 2011 |accessdate=2018-10-20}} {{DEFAULTSORT:User Agent}}2. ^1 RFC 3261, SIP: Session Initiation Protocol, IETF, The Internet Society (2002) 3. ^RFC 7231, Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content, IETF, The Internet Society (June 2014) 4. ^{{cite IETF |title=Netnews Article Format |rfc=5536 |section=3.2.13 |date=November 2009 |publisher=IETF}} 5. ^Peter Eckersley. "[https://www.eff.org/deeplinks/2010/01/tracking-by-user-agent Browser Versions Carry 10.5 Bits of Identifying Information on Average]", Electronic Frontier Foundation, 27 January 2010. Retrieved 25 August 2011. 6. ^History of the browser user-agent string. WebAIM. 7. ^{{cite web|url=http://my.opera.com/ODIN/blog/2013/07/15/opera-user-agent-strings-opera-15-and-beyond |title=Opera User Agent Strings: Opera 15 and Beyond |publisher=dev.opera.com |date=15 July 2013 |accessdate=2014-05-05}} 8. ^Burstein complaining "... I've been rejected until I come back with Netscape" 9. ^{{cite web|url=http://androidcommunity.com/forums/f8/android-browser-reports-itself-as-apple-safari-4701/ |title=Android Browser Reports Itself as Apple Safari |accessdate=August 9, 2011 |deadurl=yes |archiveurl=https://web.archive.org/web/20110806170335/http://androidcommunity.com/forums/f8/android-browser-reports-itself-as-apple-safari-4701/ |archivedate=August 6, 2011 }} 10. ^{{cite web|title=User Agent String explained: Android Webkit Browser|url=http://www.useragentstring.com/Android%20Webkit%20Browser_id_18070.php|publisher=UserAgentString.com|accessdate=29 July 2012|quote=Mozilla/5.0 (Linux; U; Android 2.2; en-sa; HTC_DesireHD_A9191 Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1}} 11. ^{{cite web|last=Pemberton|first=Stephen|title=W3C Markup Validation Service|url=http://www.w3.org/MarkUp/#guidelines|publisher=W3C|accessdate=2011-10-18}} 12. ^{{cite web|title=Browser Detection and Cross Browser Support|url=https://developer.mozilla.org/en/Browser_Detection_and_Cross_Browser_Support|work=Mozilla Developer Center|publisher=Mozilla|first=Bob|last=Clary|date=10 February 2003|accessdate=2009-05-30}} 13. ^{{cite web| url = https://www-archive.mozilla.org/build/user-agent-strings.html| title = user-agent strings (obsolete)| first = Jamie| last = Zawinski| date = 28 March 1998| accessdate = 2010-01-08| publisher = mozilla.org}} 2 : Clients (computing)|Hypertext Transfer Protocol headers |
随便看 |
|
开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。