Live data from Hacker News

UA Gotta Be Kidding

bkardell.com

11–20 of 93 posts

Re: UA Gotta Be Kidding

#12

I think it's interesting to note that the majority of web developers for at least the last 10 years have realised that the User Agent is a very flaky way to determine capability. It is almost universally ignored now (with a few enterprise-level exceptions) So the usual solution is feature detection, where the javascript and/or CSS learns the true capabilities of the browser, and switches features on and off according…

Sadly there are situations where "feature detection" is not really an option e.g. when safari does something really weird and you need a special codepath for it server-side (like the video player not working if the server doesn't support content-range, so you have to not send a video to safari in that case).

Re: UA Gotta Be Kidding

#13
What is the origin of the "U" on its own that appears in so many user agent strings?

For example: "Mozilla/5.0 (Windows; U; Windows NT 5.1; sv-SE; rv:1.7.5) Gecko/20041108 Firefox/1.0"

Re: UA Gotta Be Kidding

#15
post #8
post #3

Hm, I thought this was going to be about Ukraine (UA is its ISO code), not a browser's User-Agent string. I started by reading the comments and found them pretty confusing.

Upon opening the article the first line would have informed you otherwise. Instead you felt compelled to instead reply to tell everyone you know that UA is the Ukrainian ISO code. Did you really find the comments "confusing", or is that artistic license? It comes across like, "I couldn't just read the headline and immediately post my reaction to it". You're not the first to have this reaction to HN articles, and you…

I think you should read the HN guidelines before informing other people about how to post.

https://news.ycombinator.com/newsguidelines.html

Here are a few relevant excerpts:

- Be kind. Don't be snarky. Have curious conversation; don't cross-examine. Please don't fulminate. Please don't sneer, including at the rest of the community

- Assume good faith.

- Please don't comment on whether someone read an article. "Did you even read the article? It mentions that" can be shortened to "The article mentions that."

Re: UA Gotta Be Kidding

#16
post #13

What is the origin of the "U" on its own that appears in so many user agent strings? For example: "Mozilla/5.0 (Windows; U; Windows NT 5.1; sv-SE; rv:1.7.5) Gecko/20041108 Firefox/1.0"

[U]SA, specifically relating to encryption back when the US considered encryption munitions, and hence there were separate US and international ("I") releases supporting different crypto suites of browsers developed by US-based companies.

Re: UA Gotta Be Kidding

#17
post #13

What is the origin of the "U" on its own that appears in so many user agent strings? For example: "Mozilla/5.0 (Windows; U; Windows NT 5.1; sv-SE; rv:1.7.5) Gecko/20041108 Firefox/1.0"

universal, suitable for all audiences

Re: UA Gotta Be Kidding

#18
post #15
post #8

Earlier quoted context omitted.

Upon opening the article the first line would have informed you otherwise. Instead you felt compelled to instead reply to tell everyone you know that UA is the Ukrainian ISO code. Did you really find the comments "confusing", or is that artistic license? It comes across like, "I couldn't just read the headline and immediately post my reaction to it". You're not the first to have this reaction to HN articles, and you…

I think you should read the HN guidelines before informing other people about how to post. https://news.ycombinator.com/newsguidelines.html Here are a few relevant excerpts: - Be kind. Don't be snarky. Have curious conversation; don't cross-examine. Please don't fulminate. Please don't sneer, including at the rest of the community - Assume good faith. - Please don't comment on whether someone read an article. "Did yo…

Thank you, I believe I have met all those guidelines.

I would rather discuss the article than carry on this meta-discussion any further.

Re: UA Gotta Be Kidding

#19
The whole privacy-through-UA thing maybe gone too far though. Safari on M1 Mac identifies itself as Intel Safari. A web server knowing whether you use an older or newer Mac is not going hurt anyone, but the lack of it does hurt the UX of distributing Mac apps. For download size reasons you really want to give the user a build for the right CPU architecture, but due to this lie you have to either ship a fat app to Safari users (much slower downloads), or give up and ask the user which to pick. Chrome has an API that lets you determine the CPU arch using JavaScript.

Really there's nothing wrong with having a UA header but it gets abused because HTTP never had any standardized way to communicate feature sets. It should have had both. A way to identify specific apps for bug workarounds etc, and a way to communicate what versions and parts of the specs are implemented.

Re: UA Gotta Be Kidding

#20

The whole privacy-through-UA thing maybe gone too far though. Safari on M1 Mac identifies itself as Intel Safari. A web server knowing whether you use an older or newer Mac is not going hurt anyone, but the lack of it does hurt the UX of distributing Mac apps. For download size reasons you really want to give the user a build for the right CPU architecture, but due to this lie you have to either ship a fat app to Saf…

I'll bet that the Intel moniker was kept around because websites saw *Safari" combined with "ARM" and started serving iOS-specific cases. The sad truth is that user agent strings are being parsed through the crappiest regexes imaginable.

Web browsers are too big to send feature sets to every websites. You'd end up with kilobytes of flags that almost nobody is going to use.

If you want to keep a bug database, there's client side detection and exact UA strings to match (for now). Matching ranges of user agent versions simply doesn't work right (see the Chrome/Firefox 100 issue for an example why) and often leads to broken workaround code being sent to browsers years after a fix was made.

Post reply on HN