Contents • • • • • • • • • • • • • • • Summary Mobile: Mozilla/5.0 (Android; Mobile; rv:12.0) Gecko/12.0 Firefox/12.0 Tablet (touch screen device): Mozilla/5.0 (Android; Tablet; rv:12.0) Gecko/12.0 Firefox/12.0 Netbook (or tablet with attached pointing device, e.g. In a dock): Mozilla/5.0 (Android; rv:12.0) Gecko/12.0 Firefox/12.0 (Examples are for Firefox 12; clearly, 12.0 would change for later versions. Set custom User-Agent string. Also available for Firefox on Android. To set your custom User-Agent string, visit Add-on manager > Corresponding 'Options'. The three numbers would in all cases be the same, at least for the moment.) 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. Here's a highly crufty 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. For this reason, we have done to try and reduce UA string variance. So our hope is to provide the shortest UA string possible, encourage good practice in sniffing, avoid giving developers footguns, and (as much as possible) avoid breaking existing working sites. It is not a goal to make sites which are currently broken to work - we don't think playing that game this way leads to a good outcome, and are committed to solving that problem through and compatibility improvements to our platform. But we want to and must nail down what the string should be, so we can start the work of evangelism without the risk of telling sites things which later turn out to become false. The string above fits with the on desktop. (Our proposal is intended to replace what that blog post says about Mobile.) It also fits with the guidelines of the for Firefox products. Fennec/Firefox 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 - you get the same browser engine everywhere. Our UA string should reflect that. Platform We have put the 'Mobile' and 'Tablet' identifiers among the platform identifiers 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/ Safari'). Mobile Internet Explorer. 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). Gecko Date We have taken the opportunity to remove the Gecko date entirely (i.e. Reduce to 'Gecko/12.0' - as having something after the / is required by the HTTP spec).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
March 2019
Categories |