What are the capabilities whose detection are really needed here?
Screen size/resolution, at least, but I don’t know what else. We should
come up with a list of device features people are wanting to key their
page layout/behaviour on and see if Media Queries and other APIs are
sufficient, and if not whether it’s appropriate they’re extended to be.
If we have all our bases covered with these APIs, then I think we should
avoid forcing the device type (which is pretty much just being used as a
proxy for the specific information like screen size) into the UA string.
--
Cameron McCormack ≝ http://mcc.id.au/
The UA or even HTTP at any level is so the wrong tool for this. Media
queries etc. are the right tools here. If I have a desktop that for some
reason is bound to a small-resolution screen, I really want a website
variant that is optimized for the small screen. If I install plain
ubuntu on my phone and run desktop Firefox (yes, some crazy people have
done that), I absolutely want to small-screen-optimized website. If I
attach my TV to my phone and run at 1920x1080 (if that's not supported
on current devices, I'm sure it will come up at some point) then I
absolutely want a large-screen version of the website. Same if I attach
a desktop screen or so.
Which browser or OS you have (and that's what the UA string is for) is
totally the wrong decision criteria. Screen size and available features are.
And I have cursed "mobile-optimized" website a number of times because I
wanted info that I knew where to find on the full website and I couldn't
get to that from my phone.
Didn't we talk about "one web" for mobile and "desktop" some time ago?
Where has that philosophy gone?
Robert Kaiser
--
Note that any statements of mine - no matter how passionate - are never
meant to be offensive but very often as food for thought or possible
arguments that we as a community needs answers to. And most of the time,
I even appreciate irony and fun! :)
OT but possibly relevant experience: in WebGL, developers have been
pushing us to implement a function in the spec that returns a UA-like
string describing the GPU, we've been opposing that, and recently we
reached consensus in the WebGL WG to remove that.
It's very important to listen to developers but sometimes what they
ask for is not the best way to do what they want. UA-like strings need
to be parsed, matched against arrays of known devices... this is far
from a perfect solution from a webdev's perspective.
I don't know the specifics of your case but I'd really encourage you
to work with developers to figure what exactly they are trying to do.
For example (just an intentionally bogus example) if the reason why
they need device information is that they need to know the amount of
RAM on the device, then instead of a UA string they would be better
served by adding a function to query the RAM size.
Some more possibly useful thoughts:
1) If you're looking for an ally in pushing back against UA string
stuff, try to get Opera in the conversation. They hate UA strings even
more than we do. Happened in the WebGL discussion.
2) beyond the UA issue there is the privacy/fingerprinting issue
associated with exposing any device info. In the WebGL case we've
learned that our best approach was to be pragmatic with that: find the
best possible *compromise* between usefulness and exposing more
information, try to figure exactly what info is useful to expose. To
carry on the bogus RAM size example, if 10 devices have the same
amount of RAM, then exposing the device name is exposing useless
fingerprinting information and that's fixed by exposing RAM size
instead. Sticking to a hard line of "we won't expose any information"
is not always a very solid standpoint as many useful features are
indirectly exposing some information anyway, so we've already been
making compromises for a long time.
Cheers,
Benoit
> We have been pushing back, saying UA
> sniffing is not good for the web and that there are client side ways of
> detecting physical constraints.
>
> Now that we have build of Firefox that work really well on Android tablets,
> we see a new request: Can we get different content for tablet vs. phone?
>
> We still only support the above UA for tablets and phones, so web properties
> can't UA sniff for this difference either. We end up with many bugs filed
> for individual websites looking badly in Firefox, for both phone and tablet.
>
> Google actually has a guideline for UAs on Android:
> http://android-developers.blogspot.com/2010/12/android-browser-user-agent-issues.html
>
> <quote>
> Currently, Android devices provide the following (in addition to standard
> info) in the User-Agent: "Android", a version number, a device name, a
> specific build, Webkit version info, and "Mobile"
>
> The "Mobile" string in the User Agent indicates that this device would
> prefer a version of the website optimized for Mobile (small form factor
> devices), if available.
>
> We recommend that manufactures of large-form-factor devices (where the user
> may prefer the standard web site over a mobile optimized version) remove
> "Mobile" from the User Agent (and keep the rest of the User Agent as
> currently implemented). Web sites can then key off "Mobile" in the User
> Agent to decide on which UI version to present to the device.
> </quote>
>
> If we wanted to follow this same concept, we could:
> 1. Add "Mobile" for small form factors
> 2. Add <device> all the time
>
> Any thoughts on making a change like this? This would probably be for Mobile
> only. I don't think desktop UA would need to be changed.
I think the fundamental problem isn't that tablet and phone aren't
distinguishable from each other in the UA string but that they are
distinguishable from desktop in the UA string. If we showed the same
UA string across desktop, laptop, tablet and phone, Web authors would
have to sniff what they really care about (screen size relative to
text size, availability of touch events).
> If we wanted to follow this same concept, we could:
> 1. Add "Mobile" for small form factors
That might be jumping from the frying pan into the fire.
Opera Mobile doesn't say "Opera Mobile" in its UA string even though
that's the product's name. On tablets (dunno what's the definition of
"tablet" for Opera; Galaxy Tab 10.1 is one), it says "Opera Tablet" in
the UA string even though the user-facing branding is "Opera Mobile".
On phones, it says "Opera Mobi". Opera's UA string on mobile is so
crufty that I can't believe they are optimizing 2 bytes off the
string. I'm guessing they say "Mobi" instead of "Mobile" to avoid
sniffers that look for "Mobile" and decide that anything that's
"Mobile" need dumbed-down content.
If Opera avoids putting "Mobile" in the UA string, chances are that we
should, too.
Speaking of toxic substrings, I think we should seriously consider not
putting the substring "Android" in the UA string. If making the
Android UA string indistinguishable from desktop Linux falls outside
the Overton Window, I think we should say e.g. "Andr" instead of
"Android" to avoid sites assuming that Firefox is WebKit or that
Firefox should get a dumbed-down "mobile" site. I think removing
"Fennec" would be good, too, to make it harder to sniff mobility from
the UA string and to make authors use Media Queries.
(I'm running Nightly on Galaxy Tab 10.1 with the UA string faked to be
desktop Linux on x86_64. This improved my Twitter experience
significantly. However, it seems that e.g. OMG! Ubuntu sniffs for
unfaked properties on the navigator object and still gives me a
dumbed-down version of the site.)
> 2. Add <device> all the time
I think we shouldn't do this for two reasons:
1) Fingerprinting
2) Letting authors sniff by device name is even worse than by letting
them sniff by device class. There's no way the long tail of Web sites
will be maintained enough to keep knowledge of all possible devices
up-to-date and, realistically, sites won't know about all possible
devices to begin with. Letting authors sniff by device name would hurt
users. Either the site does something really nice for some the devices
it knows about and discriminates against users of other devices or the
site does something really clueless for devices in it's list of
"mobile" device names and makes the experience bad on fully-capable
browsers that are running on devices that sniff as "mobile".
--
Henri Sivonen
hsiv...@iki.fi
http://hsivonen.iki.fi/