9 ms·
"...user agent strings are a giant disaster of technical debt" Amen. I agree with the commenter below who suggests we use random strings instead. Unless ther
by echochar 11y ago
"...user agent strings are a giant disaster of technical debt"
Amen.
I agree with the commenter below who suggests we use random strings instead. Unless there is some sort of published standard for what this header should contain and what each byte means, the contents may as well be random.
The "history" of "user-agents" (about 20 years) is not very long, assuming the web is going to last more than 20 years into the future. Taking a long view, we are still in the nascent phase.
- kobayashi 11y agoAre you suggesting unique randomized strings for every user?
- deleted 11y ago[deleted]
- debaserab2 11y agoI'm sorry, but I still find the user agent string to be incredibly useful despite it's many shortcomings. Not so much for deciding what to serve to a request, but moreso to analyze your audience and figure out from a technical perspective what is feasible and what is not. For example, a recent decision I made was to decide whether or not to rewrite a portion of our application in a javascript framework that did not offer IE8 support. I was able to quickly validate what portion of my userbase I was affecting by looking at user agent strings. Request headers are a fantastic way to capture this little bit of information. Using javascript feature checking depends on a javascript engine successfully loading and parsing whatever scripts I've provided to the client. Request headers are simple plaintext that don't fail in even the most bare bones of situations.
- fkooman 11y agohttps://en.wikipedia.org/wiki/Progressive_enhancement https://en.wikipedia.org/wiki/Progressive_enhancement https://en.wikipedia.org/wiki/Fault_tolerance https://en.wikipedia.org/wiki/Fault_tolerance No need to do browser detection. Just make your site work without JS as well :)
- jerf 11y agoTen years ago, that may have been valid advice, when "dynamic" mostly meant "server-generated". But if you're creating a website that is heavily JS-based, it does no good to serve 25% of your customers a perfectly-standards-compliant page telling them their JS won't work, so the site can't do its thing. You still need to know what client base you are supporting, no matter what.
- jakeogh 11y agoThat would be better, but not per user, per session. Currently I have surf(suckless.org) just pick a common one when I launch a tab (via tabbed): https://github.com/jakeogh/rndagent https://github.com/jakeogh/rndagent
- pdkl95 11y agoper-HTTP request Nothing ever guaranteed the user agent header would be consistent or present. Any re-use of a user-agent string adds bits of data that can be used for tracking.
- nitrogen 11y agoWhile we're at it, we need some solution to tracking based on browser window size. I'm one of the few people I know who doesn't maximize everything, so I'm probably 100% uniquely trackable just by window size.
- quesera 11y agoWindow size detection is done with JavaScript. Block it.
- JupiterMoon 11y agoIt can apparently be done with CSS by a determined website.
- jakeogh 11y agoDisable JS by default. I do, and it makes the web better. Surf/tabbed makes this easy to do per process.
- deleted 11y ago[deleted]
- tomjen3 11y agoIf you do that, you are gong to break so many websites.
- userbinator 11y agoAll the better to let them know they shouldn't be doing that.
- adrianN 11y agoThat will be very popular with the users of your browser.
- HappyTypist 11y agoNo, I mean, a tiny bit of css hacking will let you detect it. Have a css media query for every possible height, and every possible width, that loads a 1px empty png.