Account confirmers, Anti-spam team, Confirmed users, Bureaucrats and Sysops emeriti
4,925
edits
No edit summary |
No edit summary |
||
Line 21: | Line 21: | ||
==Rationale== | ==Rationale== | ||
User Agent strings accumulate cruft, and complex ones lead to server-side parsing which makes all sorts of wrong assumptions about browser capabilities which can't then be fixed on the client-side apart from by adding more cruft. Note what happened when sites started using "Gecko" as a synonym for "standards-compliant"; WebKit browsers still have "like Gecko" stuck in their User Agents. | User Agent strings accumulate cruft, and complex ones lead to server-side parsing which makes all sorts of wrong assumptions about browser capabilities which can't then be fixed on the client-side apart from by adding more cruft. Note what happened when sites started using "Gecko" as a synonym for "standards-compliant"; WebKit browsers still have "like Gecko" stuck in their User Agents. Here's an example from current iPads: | ||
Mozilla/5.0(iPad; U; CPU iPhone OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B314 Safari/531.21.10 | |||
In addition, variance in the user agent string adds additional bits of entropy which can be used for browser fingerprinting. For this reason, we have done work in Firefox 4 and beyond to try and reduce UA string variance. | In addition, variance in the user agent string adds additional bits of entropy which can be used for browser fingerprinting. For this reason, we have done work in Firefox 4 and beyond to try and reduce UA string variance. | ||
Line 31: | Line 33: | ||
We have removed the "Fennec" identifier because we don't want sites to detect that instead of Firefox or "Mobile" or "Tablet". Our market share is currently small enough that we hope we can get away with this without breaking too many sites. Mobile Firefox is Firefox - it's not something else. That's one of its great selling points - same browser engine everywhere. | We have removed the "Fennec" identifier because we don't want sites to detect that instead of Firefox or "Mobile" or "Tablet". Our market share is currently small enough that we hope we can get away with this without breaking too many sites. Mobile Firefox is Firefox - it's not something else. That's one of its great selling points - same browser engine everywhere. | ||
We have put the "Mobile" and "Tablet" identifiers where the platform identifiers were because that's the logical place for them to go. Anyone sniffing for the string "Mobile" doesn't care where they are. Firefox is not going to match anyone sniffing for "Mobile Safari" wherever we put the word "Mobile" (and sometimes that string isn't present on WebKit anyway, as some Webkit UAs have "Mobile/<ver> Safari"). Mobile Internet Explorer [http://blogs.msdn.com/b/iemobile/archive/2010/03/25/ladies-and-gentlemen-please-welcome-the-ie-mobile-user-agent-string.aspx uses "IEMobile"]. So really, just sniffing for "Mobile" is the way to find all these mobile browsers. | We have put the "Mobile" and "Tablet" identifiers where the platform identifiers were because that's the logical place for them to go. Anyone sniffing for the string "Mobile" doesn't care where they are. Firefox is not going to match anyone sniffing for "Mobile Safari" wherever we put the word "Mobile" (and sometimes that string isn't present on WebKit anyway, as some Webkit UAs have "Mobile/<ver> Safari"). Mobile Internet Explorer [http://blogs.msdn.com/b/iemobile/archive/2010/03/25/ladies-and-gentlemen-please-welcome-the-ie-mobile-user-agent-string.aspx uses "IEMobile"]. So really, just sniffing for "Mobile" is the way to find all these mobile browsers. (Although iPad also says "Mobile".) | ||
On the tablet side, Opera already calls itself "Opera Tablet" when running on a tablet, so there is also precedent for using that string to identify tablets, and for varying a tablet UA compared to desktop. The iPad identifies itself as an "iPad" instead of a "Macintosh" (clearly, Apple isn't going to use the generic device name). | |||
If the device is not actually a touch tablet, e.g. a netbook, we want a "desktop-like" UA. Saying the platform is "X11", while not always technically correct, is our attempt to balance accuracy, cross-platformness and compatibility with existing desktop sniffing. | If the device is not actually a touch tablet, e.g. a netbook, we want a "desktop-like" UA. Saying the platform is "X11", while not always technically correct, is our attempt to balance accuracy, cross-platformness and compatibility with existing desktop sniffing. |