6 ms·
History of the browser user-agent string
- gnur 13y agoThe real question is, is this still needed in the modern web? I have never used the user agent to serve different content. I do expect that some sites still use the user agent for detection of mobile browsers but that is also deprecated for people with common sense..
- mherdeg 13y agoThe User-Agent field is a great way to detect a polite robot (and even, if it supports robots.txt, to ask it to avoid certain pages). So this header field is a useful signal for analytics. It's not at all trustworthy, but in practice it's useful.
- streptomycin 13y agoIt's still needed in many cases. For instance, I wrote an IndexedDB-heavy web app. It doesn't work in browsers that don't support IndexedDB. So I do feature detection and if IndexedDB is not supported, I show an error message telling the user that if they want to run the app, they have to use a more modern browser like Firefox, Chrome or IE10. ...except on iDevices, where it is literally impossible to install any browser that supports IndexedDB, despite the fact that it is possible to install something called "Google Chrome" that is not really Google Chrome. So I do user agent detection to display a different message to those users, so as to not give them false hope and confusion.
- Touche 13y agoYou can use a polyfill that falls back to WebSQL (Supported on iOS): http://nparashuram.com/IndexedDBShim/ http://nparashuram.com/IndexedDBShim/
- streptomycin 13y agoI tried that and couldn't get it to work. Seems I'm not the only one with problems https://github.com/axemclion/IndexedDBShim/issues https://github.com/axemclion/IndexedDBShim/issues Admittedly I could invest more time to try to get it working, but iOS represents a relatively small fraction of my users and even a working shim could have problems (IIRC there are serious bugs with WebSQL in iOS 7, not sure if they've been fixed; also, I don't know what this shim approach would do to performance in an IndexedDB-heavy app).
- inafield 13y agojQuery does not actually solve every possible cross-browser compatibility issue. I still occasionally have to code around some browser issue, especially considering the lack of good plugins to support localStorage.
- jmpe 13y agoOff course it still has its use. It comes in handy when you forget your d-link router password.
- ronancremin 13y agoYes. The user agent (UA) string is used by almost every major web brand for one or more of the following purposes: - To serve different levels of experience to different classes of browsers. This is necessary if you want global coverage i.e. all classes of devices and connectivity. The payload of desktop version of Google is fully 140x bigger than the lightest mobile version, Facebook is similar (check this on http://prism.mobiforge.com http://prism.mobiforge.com). RWD can't do this (many RWD sites simply don't load at all on lower-end phones). - Serving different experiences to different types of devices e.g. desktop / mobile / TV etc. Don't think this is necessary? Try some of the sites mentioned with a different UA strong and see how it feels. - Analytics. Google Analytics, Omniture etc. all rely on the UA string to identify types of devices/browser. - To offer links to the correct app stores for the various mobile OSes - To make sites faster/lighter for lower end devices. This is important for low-speed connections, faster page loads, metered data plans.
- gnur 13y agoAh good point. But what I really meant, and that isn't really clear from my post: Is wether we still need the addition crap that is in a user agent string. A user agent should be more like this: <Operating System> <version>, <browser> <version>, <devicetype>, <connection type>(high speed unmetered, 3g metered etc)
- philbarr 13y agoA great explanation that also made me laugh. I've never really thought of the browser vendors trying to impersonate each other before; sort of, "competing" for content. I always thought they just did what they liked and we all had to hack around it.
- renekooi 13y agoAnd they've all been hacking around our hacks!
- ozh 13y agoAll this was meant to fund Senior JAVA Dev jobs like this one: http://thedailywtf.com/Articles/The-Enterprise-User-Agent.aspx http://thedailywtf.com/Articles/The-Enterprise-User-Agent.as...
- AlexanderDhoore 13y agoWow. Just, wow. That's beyond insane. "Based on the commit history, it took several months to create this masterpiece." ...
- kippetlong 13y agoWhy do you capitalize Java like that? It's not an acronym or an abbreviation. It's just a word - named after the type of coffee from the Indonesian island of the same name.
- patrickmay 13y agoMy user agent is "Drakma/1.3.0 (SBCL 1.1.5; Darwin; 12.2.0; http://weitz.de/drakma/)" http://weitz.de/drakma/)". I like to keep webmasters on their toes.
- slashdotaccount 13y agoThe ad companies and the NSA can identify you easier than usually.
- jakub_g 13y agoI pretended to use WinRAR (long time ago to make fun on some boards), until I've encountered https://panopticlick.eff.org/ https://panopticlick.eff.org/
- raldi 13y agoThen you probably should have a redirect at http://weitz.de/drakma/)%22 http://weitz.de/drakma/)%22 instead of a 404.
- tankenmate 13y agoActually this history has one minor mistake (there may be more); Microsoft didn't make their own web browser, well at least not initially, they licensed their code from Spyglass.
- iLoch 13y agoSounds like we could really use a "User-Agent-Features" header or something similar. Or we just say screw it and make a new standard for the User-Agent header, then users can run in compatibility mode when needed.
- pornel 13y agoAnd now we have Chromium-based Opera which can't call itself Opera and has to use "OPR/16" instead, and pretends to be Chrome, which pretends to be Safari, which pretends to be KHTML, which pretends to be Gecko, which pretends to be Netscape. On a related note W3C+Mozilla are trying to document use-cases for UA sniffing: https://etherpad.mozilla.org/uadetection-usecases https://etherpad.mozilla.org/uadetection-usecases
- sneak 13y agoI think it's lunacy to send do-not-track... with a user-agent alongside. The user-agent header is an artifact of history, and should be abolished. I can see no use case for it aside from standards-avoidance.
- eropple 13y ago> I can see no use case for it aside from standards-avoidance. That's true, but one's platonic idea of the browser does take a backseat to reality.
- jakub_g 13y agoDon't forget the IE11 which pretends to be Gecko and to not be MSIE [0]. [0] http://www.nczonline.net/blog/2013/07/02/internet-explorer-11-dont-call-me-ie/ http://www.nczonline.net/blog/2013/07/02/internet-explorer-1...
- Cthulhu_ 13y agoI haven't had to deal with user agents in a while, thankfully. Except today; the client wants the user to be presented the mobile site we built, or the old desktop site, depending on user agent. I'm not going to parse no user agent strings though - there's an open source library / database called WURFL [1] that can do all those things. Hopefully. [1] http://wurfl.sourceforge.net/ http://wurfl.sourceforge.net/
- toblender 13y agoWow this is awesome, it answers so many questions. I'm actually surprised that Mozilla didn't sue the other browser for using its name in their User-agent browser. This may have secured Mozilla's place as #1.
- angersock 13y agoAnd then mobile happened, and everything was fucked forever. :(
- Spoom 13y agoThe pseudo-Biblical writing style reminds me of The Book of Mozilla[1], perhaps the coolest browser easter egg in existence, which, sadly, Chrome decided not to implement. 1. http://en.wikipedia.org/wiki/The_Book_of_Mozilla http://en.wikipedia.org/wiki/The_Book_of_Mozilla
- pilif 13y ago> And Internet Explorer supported frames, and yet was not Mozilla, and so was not given frames. I don't think that is correct. IE 2 didn't support frames. IE 3 did, but 2 didn't. I remember waiting for IE3 to get more market share so that I could safely use frames. I can't tell you what feature made them fake the user agent, but it wasn't frame support. Yeah. Those were the days :-)
- ronancremin 13y agoThe author reaches a trite conclusion uninformed by facts. The user agent string is used by at least 90+% of the Alexa 100 to improve user experience. There is a silent evidence problem here. Successful use of the user agent string improves the user experience but goes unnoticed; failures are very apparent. From the article: "user agent string was a complete mess, and near useless" vs. https://etherpad.mozilla.org/uadetection-usecases https://etherpad.mozilla.org/uadetection-usecases His conclusion is a bit like saying "I don't see why I need ABS in this car because I've never skidded since I got it."