News for hackers. Stuff that matters.
Re:Why Parse the User Agent? by calineczka on Saturday November 22, 2014 @07:24PM (#8647243)
I imagine that in the future with HTTP2 we could send the list of available browser features as HTTP headers such as Animated-WebP: Supported ? With HTTP1 the cost of sending long list of available features would be too big probably. But could HTTP2 solve this problem. If I recall correctly it only sends diffs of headers between subsequent requests in the same connection. Maybe that could be helpful for a class of problems like this one and similar.
Re:Why Parse the User Agent? by jed_watson on Sunday November 23, 2014 @03:47AM (#8648200)
I was just thinking a similar thing. If user agents have evolved to effectively become a way of saying "Our browser supports standards X" (where X is an awkward grouping based on which features vendors and browser versions originally supported the feature / standard), surely the ultimate solution is to provide a header enumerating support on a per-feature basis.

Obviously it would take a while for the standard to be adopted to the point where it was useful, but as a web developer I dream of a time when we receive a header that lists the supported features in the client (similar to the classnames modernizer adds to the document body, and probably eventually versioned) and no longer have to resort to either UA parsing OR javascript-based feature detection, both of which are hacks because this problem hasn't actually been solved properly at the standards level.

Re:Why Parse the User Agent? by ploxiln on Saturday November 22, 2014 @11:19PM (#8647786)
The linked page mentions the Accept header, and notes that some popular browsers got it wrong at some point (maybe still?) so now no one can use it anymore. You propose something more specific, but not very different. It'll fall to the same fate eventually, but might give us a couple of years...
Re:Why Parse the User Agent? by gurkendoktor on Sunday November 23, 2014 @10:16AM (#8648950)
I don't think this is a viable solution because vendors are going to get the list wrong. Mobile browsers are a complete mess. Do you think that Apple would have sent a "File upload: Unsupported" flag when they temporarily broke file uploads in iOS 8.0?
Re:Why Parse the User Agent? by csirac2 on Sunday November 23, 2014 @05:44AM (#8648387)
In this specific use-case wouldn't plain old content-negotiation/accept headers work?