User Agent String Changes On WebKit Trunk
Recently some changes to the User Agent (UA) string have landed. These changes are designed to add UA string detail, remove redundancy, and increase compatibility with Internet Explorer, and are happening in conjunction with similar changes in Firefox 4.
Here are a few sample pre-change UA strings:
Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/534.27+ (KHTML, like Gecko) Version/5.0.4 Safari/533.20.27
Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_7; en-us) AppleWebKit/534.27+ (KHTML, like Gecko) Version/5.0.4 Safari/533.20.27
Here are the equivalent post-change UA strings:
Mozilla/5.0 (Windows NT 6.0; WOW64) AppleWebKit/534.27+ (KHTML, like Gecko) Version/5.0.4 Safari/533.20.27
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_7) AppleWebKit/534.27+ (KHTML, like Gecko) Version/5.0.4 Safari/533.20.27
In detail, the differences are as follows:
- On Windows, the initial “
Windows;” platform identifier has been removed. This string is also present in the subsequent OS version identifier, and removing it is more compatible with Internet Explorer, whose UA string doesn’t have this initial token.
- The “
U” SSL encryption strength token has been removed. This token dates from more than a decade ago, when U.S. export laws limited the encryption strength that could be built into software shipped to various other countries; the valid values are “
U” (for “USA” 128-bit encryption support), “
I” (for “International” 40-bit encryption support), and “
N” (for “None”, no encryption support). These days, it’s unusual to ship without 128-bit SSL support everywhere; ports can add “
I” or “
N” if necessary.
- On 64-bit versions of Windows, tokens have been added after the OS version. 32-bit builds running on 64-bit Windows have added “
WOW64”. (“WOW64” stands for “Windows 32-bit On Windows 64-bit” and is the name Microsoft gives its 32-bit compatibility subsystem.) 64-bit native builds use “
Win64; x64” for x64-based processors and “
Win64; IA64” for Itanium systems. These tokens are useful for sites that need to provide download links for native executables, and match what Internet Explorer uses.
- The locale has been removed. Web authors who want to know what languages a browser supports should use the HTTP Accept-Language header instead, which can supply multiple locales.
- Windows CE builds of Qt-based ports should report the OS version slightly more accurately (e.g. “Windows CE 5.1” instead of “Windows CE 5.x” or “Windows 5.1”).
As various ports ship these changes, you might notice web compatibility problems. If so, please point webmasters to this post, and/or file bugs in the bug tracker.