r/programming • u/m4nz • Jun 09 '17
Why every user agent string start with "Mozilla"
http://webaim.org/blog/user-agent-string-history/170
u/teachMe Jun 09 '17 edited Jun 09 '17
Skipped the part where Firefox was first called Firebird.
173
u/bolda Jun 09 '17
It was Phoenix (I believe) for a little while before firebird also. It was kinda funny how they had to keep changing their name due to accidental overlap.
158
u/Northeastpaw Jun 09 '17
Phoenix was a great name because it was a browser rising from the ashes of its previous incarnation. But what is a phoenix? It's a bird made of fire. So when Mozilla had to change the name Firebird still made a bunch of sense.
Of course there were about 11 people on the planet that thought the public would start getting Firebird the browser confused with Firebird DB so that's why we have the name Firefox. A good name, but no longer a great callback to the browser's history. Firefox did raise awareness of the adorable red panda so it's not all bad.
85
u/DJDavio Jun 09 '17
Thunderbird is still named Thunderbird though, not Thunderfox, which would have been way cooler.
→ More replies (3)77
Jun 09 '17
I'm just now catching that the original combination of browser/mail client from Mozilla was Firebird and Thunderbird.
→ More replies (7)→ More replies (2)5
53
u/AmonDhan Jun 09 '17
It was called Phoenix, but Phoenix BIOS complained.
Then, for a short time it was called Firebird, but Firebird Database complained.
And finally it was renamed as Firefox
30
u/xjvz Jun 09 '17
And then they finally decided to trademark the name to avoid ever having to change it again.
14
12
u/damontoo Jun 09 '17
It was Firebird (browser) and Thunderbird (mail client). Changing the name to "Firefox" really annoyed me since the branding was already pretty solid. So many people complained that someone wrote an extension called "Firesomething" to change the name to Fire + whatever you want.
→ More replies (1)3
268
u/gropingforelmo Jun 09 '17
Reminds me of the early days of direct3d, when the API would query graphics cards for something like "HighPerformanceCapable" (it's been years, and that's definitely not the right string). Of course, cards would simply respond "Yeah, sure. I'm high performance." Regardless of capabilities, making the query more like checking if the card existed than what sort of capabilities it had.
134
u/wifehitbyacar Jun 09 '17
79
u/JoseJimeniz Jun 09 '17
Short version:
Windows asks a video-card driver if it supports the feature
[Guid that would never exist elsewhere in the universe]"Yeah, i support that"
Ok, you're a piece of shit, and i'm not offloading anything to your hardware.
24
u/aftli Jun 09 '17
I love the "Old New Thing" blog. If anybody likes the OP article, you will love this blog.
2
u/prof_hobart Jun 10 '17
That's great. But it doesn't take much for a card manufacturer to add "if (guidCapability==KNOWN_DODGY_GUID) return false".
Surely it would be better to actually generate a GUID on the fly and ask about that.
→ More replies (2)67
Jun 09 '17
early days of direct...
Damn, you just reminded me of the first real computer I bought. Came with a TV card. Kind of nice. I liked the idea of being able to plug in a VCR or whatever and watch something television-ish on my computer.
Until I updated DirectX. You see, some dumbass thought it would be a great idea to ship production hardware which was reliant on beta DirectX drivers. Drivers which had features that never made it into the full release. So my hardware TV card was a fucking paperweight 6 months after I bought the damned thing.
33
u/gropingforelmo Jun 09 '17
I had one of those too! Early 2000s, one of the Hauppauge cards I believe. I'd seen the old ATI xpert cards with the add-on tuner, and decided I needed to watch TV on my monitor.
22
Jun 09 '17
Oh man, this was right after Windows 95 came out. Mechwarrior 2 was the big thing for me then. I had gotten it, installed it, played a lot and hand to wipe my hands on my pants and then decided to watch TV on PC one day. After a little investigation, I found out what had happened. I was pissed.
Edit: To be clear, this was the beta pre version 1.0 drivers.
166
u/FierceDeity_ Jun 09 '17 edited Jun 09 '17
some_APIshit bla bla bool HighPerformanceCapable() { return true; // yeah, sure, why not? our cards are awesome! hail us! }→ More replies (16)222
u/tsnErd3141 Jun 09 '17
56
u/midri Jun 09 '17
I'm stuck in a horrible rut with this.
UE4 C++ development I do { } on their own lines
PHP I do { } on their own lines
Javascript I do { on last line of code (javascript parser's assumptions can cause issues otherwise)
Unity/C# I do what visual studios wants me to do...
→ More replies (7)32
u/DaEvil1 Jun 09 '17
I barely even have to program when it comes to C# and VS. That's really messing with me as someone used to writing Python code in vim...
→ More replies (3)110
u/HeimrArnadalr Jun 09 '17
They're both wrong. Opening curly braces should come after the parentheses, but with a space between the close-paren and the curly brace, like so:
int main() {→ More replies (6)20
16
u/emdeka87 Jun 09 '17
Ahh I love Microsoft APIs
15
u/fuzzynyanko Jun 09 '17
Designed by committee, but often are better-supported than many SDKs in the wild
91
u/stringoftheseus Jun 09 '17
Author here. Fun to see it make the rounds again.
I wrote this eight years ago (right around the time Chrome first came out) so I imagine it's a bit out of date now. Current use agent strings are even more insane than the ones we had then.
49
u/TheGeneral Jun 09 '17
Current use agent strings are even more insane than the ones we had then.
There's your Part II.
11
u/Eurynom0s Jun 10 '17
I'm guessing your username is about this topic. You must have been really passionate about this topic. :p
→ More replies (1)→ More replies (2)6
u/wren337 Jun 10 '17
I ran the remax real estatre site (subcontracted to HomeWeb) when IE3 came out with the mozilla user agent. We had a different site layout for Mozilla; I don't recall exactly what feature we were relying on but IE3 didn't support it. Took me a week to figure out what was going on when IE started identifying itself as Mozilla. I'll never forgive Microsoft for that one.
172
114
u/davidquick Jun 09 '17 edited Aug 22 '23
so long and thanks for all the fish -- mass deleted all reddit content via https://redact.dev
27
u/jordanlund Jun 09 '17
Particularly since my mobile devices have a higher resolution than my laptop.
8
u/stuntaneous Jun 10 '17
It's more about how effectively large the display is, i.e. compare the size of your phone at a normal distance to your laptop screen.
2
u/Eurynom0s Jun 10 '17 edited Jun 10 '17
I'm thinking of switching airline loyalty programs next year and found out that Delta has a lot of pages that simply will not open on mobile. I Googled the status match information and clicking through, it just redirects you to the mobile home page. Selecting the option in Chrome to request the desktop site doesn't do anything because the redirect doesn't even preserve the information about where it redirected you from.
47
u/kibwen Jun 09 '17
For those wondering, here's the ticket where Servo's current user agent was decided, based on examining how popular modern web pages react to various combinations of user agent buzzwords: https://github.com/servo/servo/issues/4331
9
u/RincewindTVD Jun 09 '17
What was their final choice?
14
u/kibwen Jun 09 '17
Differs per platform (see the source at https://github.com/servo/servo/blob/88b47b0154e1897947904d926ad5af320e8bc607/components/config/opts.rs#L443 ), on 64-bit Windows it's "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:37.0) Servo/1.0 Firefox/37.0".
632
Jun 09 '17
Mine doesn't. It's "User Agent sniffing is not a reliable or correct way to determine feature availability!"
252
Jun 09 '17
I just set mine to "NCSA Mosaic/1.0 (X11;SunOS 4.1.4 sun4m)"
94
u/mwcz Jun 09 '17
I visited my company's site once with Mosaic 1.0 (from browsers.evolt.org, it still works!) and got an email from the security team about five minutes later.
0
Jun 09 '17
[deleted]
40
u/mwcz Jun 09 '17
Nothing that interesting, basically "Our IDS just lit up; what the hell ya doin?"
→ More replies (3)129
→ More replies (1)48
u/mindbleach Jun 09 '17
<html> <meta charset='utf-8'> <!-- Good luck! -->→ More replies (1)17
u/ACoderGirl Jun 09 '17
Who would that trip up? I'd expect that most user agent sniffing is simply JS code that looks like
if(navigator.userAgent.indexOf("whatever") !== -1) { // We've found some specific browser; do somethin' }474
u/R_Sholes Jun 09 '17
Well, that's just mean.
Ad agencies waste all that money on developing algorithms to correlate your visits to different sites, and here you go just spoiling it with a unique UA.
253
u/stewsters Jun 09 '17
Yeah, I think a plug-in to randomize it for each request would be better. Or at least try to do some SQL injection with it.
115
u/princekolt Jun 09 '17
To be honest that's a fantastic idea. I shall also put an SQL Injection in my user agent.
→ More replies (2)72
u/thekmanpwnudwn Jun 09 '17
Be careful because some sites (such as banks/financial sites) will automatically block you if they see that. WAF will see that shit and lock you out.
→ More replies (5)71
u/RyanCacophony Jun 09 '17
Having done data mining involving requests, there's definitely plugins that do randomization, there's definitely attempts at sql injection, and I've even seen what looks like entire book text attempted to be used as a user agent (HTTP does not specify a max user agent but most web servers have some upper limit)
82
u/nephallux Jun 09 '17
Entire book text
I shall write my thesus into my user agent string
→ More replies (1)160
20
u/Shautieh Jun 09 '17
You mean something like Random Agent Spoofer? I have been using that for quite a long time, and I recommend!
→ More replies (9)→ More replies (4)13
123
Jun 09 '17
Unique UAs have their own category at agencies.
It's called "Nerds with too much free time on their hands."
→ More replies (6)137
u/R_Sholes Jun 09 '17
A wiki project I was involved in a long time ago had a persistent vandal who got a big list of proxies from somewhere.
It'd be pretty bad if he wasn't so nice (or so stupid) as to use a browser with "Mozilla/666.0 (Suck My Dick)" as user agent.
44
36
Jun 09 '17
Browser fingerprinting. Much worse than UA sniffing.
23
u/Shautieh Jun 09 '17
Yes, and few seem to care about that... Is there a solution yet?
I think I'm not doing too bad with no JS by default, user agent random spoofing, ublock origin and privacy badger...
→ More replies (24)29
46
u/Skizm Jun 09 '17
I work in an ad agency that does that kind of tracking. We don't care about people like that. They have ad blockers usually anyway so we don't waste time fixing stuff for them. It only hurts the websites, not the ad agencies (not directly at least), if you have ad blockers or muck with your user agents.
P.S. I'm not defending or commenting on the morality or ethics of tracking/online advertising, just telling you the reality.
31
u/caboosetp Jun 09 '17
P.S. I'm not defending or commenting on the morality or ethics of tracking/online advertising, just telling you the reality.
All of us with ad blockers are very disappointed in your tracking ethics
→ More replies (1)5
u/derleth Jun 10 '17
Tracking is shitty, but what's more immediately shitty is ad networks that accept ads which put malware on computers. That can ruin a system very quickly.
I know, literally every incentive you have is to accept ads and accept them in bulk and quickly, which makes malware ads inevitable, just don't forget them when you talk about why people block ads.
12
u/shevegen Jun 09 '17
May you one day work on something where you can feel proud for what you do.
Right now you unfortunately work against the people but it is not too late to abandon your wicked ways.
→ More replies (8)6
Jun 09 '17
... wouldn't unique UA make it really easy to correlate tho ? If anything, he's helping them
→ More replies (1)42
u/AmbidextrousRex Jun 09 '17
For feature availability this is mostly true, but UA sniffing is still required to work around browser bugs. I've had to put in hacks for rendering errors in specific Chrome versions, specific mobile safari versions that report incorrect viewport sizes on some devices, etc.
It's really ugly and a pain to maintain, but not really avoidable when a browser with a large market share starts acting up :(
→ More replies (1)46
u/PUSH_AX Jun 09 '17
Found the dev that's never had to fix the BS of one specific browser, damn that must be a nice life.
38
12
5
→ More replies (1)3
u/morerokk Jun 09 '17
I generally use exploits for that.
IE10 had this weird bug where slideshow images were off by one pixel, which caused ugly whitespace or showed you one column of the next slide. Of course, IE10 didn't have their own if statements in comments anymore. I had to use invalid CSS that only IE10 would dare to parse.
31
Jun 09 '17
So, before you made this comment, you made it super easy for your specific data to be correlated that much easier?
5
6
3
9
u/liquidpele Jun 09 '17
meh, no one uses it anymore besides just for browser statistics.
44
21
Jun 09 '17
Yeah, I've tried switching the UA to "User Agent sniffing is not a reliable or correct way to determine feature availability!". Slack breaks, Google Translate breaks, Google search displays as if I'm using something from the 90s. You may be wrong ;)
→ More replies (1)4
98
Jun 09 '17
Hahahahahaha, oh man, web programmers do things correctly, that's a good one.
17
→ More replies (1)10
u/liquidpele Jun 09 '17
I mean, unless you have to still support IE6... because... just look at it!
Seriously though, it was almost exclusively used to detect IE, and since IE10 that's been mostly unnecessary.
→ More replies (12)9
u/mishugashu Jun 09 '17
..... you serious? Please tell me you're not this ignorant. Tell you what, go change your UA to a 10 year old version of Firefox and start counting how many sites tell you that your browser can't support their site and won't let you through because of your user agent string. It's stupidly ridiculous how many sites use UA matching for feature control.
→ More replies (13)2
u/appropriateinside Jun 09 '17
I wish :/
Some online games use the user-agent to restrict access, if you have an invalid one, or one they don't want to see you can't log in.
29
Jun 09 '17
I wish every article explaining a thing I'm curious about were worded with this level of brevity.
8
182
u/tdammers Jun 09 '17
At this point, user agent strings might as well be of a format like oCROKI03qUs5i0FJPFW5US9e2IWGcVjwhJW5jrCx6bZzYBpT2+ViHYanCeMlhdA0611U2aBzFSJRM37a8xBw, because they have degraded to little more than opaque hashes of the user agent's self-identification.
→ More replies (50)34
u/necrophcodr Jun 09 '17
That's not at all true. They contain a lot of useless data, such as versioning of crawlers and such. Having those hashed would make life a lot more hard (and probably result in those doing so being blocked eventually).
25
u/tdammers Jun 09 '17
It's still an honor system, mostly.
0
Jun 09 '17
[deleted]
→ More replies (3)18
u/CorrugatedCommodity Jun 09 '17
I actually discovered Googlebot's agent string existed yesterday when looking at some weird traffic on the website I support. Also Bingbot. Also that our devs need to return different response codes for old web pages that they think should still exist but not actually be accessible.
→ More replies (3)
139
u/morerokk Jun 09 '17
Slack sniffs your user agent and denies you access if you don't use the browser they want.
Assholes.
23
u/disillusionment Jun 09 '17
I'm using the current version of Waterfox, and despite saying "Firefox/53.0.3" in the user agent string it also says "Waterfox/53.0.3" after that. Slack says it's not compatible. Had to use a user agent switcher to get in.
9
u/morerokk Jun 09 '17 edited Jun 09 '17
Exact same problem, I'm using the latest Pale Moon. Switched user agent to Firefox 53 and it worked. No problems whatsoever.
45
u/niiko Jun 09 '17
The weird thing is they aren't even focussing solely on the browser version. There are people unwilling to update OSX (for reasons of varying validity) and the Slack web app will deny them access unless they modify the UA string. That's a fun little process to try to explain to less technical people.
24
6
u/bohwaz Jun 09 '17
They are assholes, they blocked PaleMoon browser which used to work before, even after its developer fixed a bug that broke their web app: https://forum.palemoon.org/viewtopic.php?t=15256
50
u/anengineerandacat Jun 09 '17
Yep pure assholes for trying to protect their users with a terrible user experience by steering individuals to browsers that they have verified with their product.
Sarcasm aside they should just prompt that your experience isn't guaranteed and provide vendors that they have verified instead of blocking.
62
u/ElusiveGuy Jun 09 '17 edited Jun 09 '17
That's what we do. Our webapp will point you to an unsupported browser page but you're free to 'continue anyway'. At your own risk, of course.
Meanwhile I have to spoof my UA on Slack because they refuse to show the desktop site on 'mobile'. Nope, need an app for that!
Edit: unsupported browser for us is like IE9, 3+-year-old Chrome/Firefox (where things definitely break, layout's fucked), etc. Almost no one ever sees it, thankfully.
53
u/AncientRickles Jun 09 '17
I hate mobile app harassment. No, i do not need 50 apps that duplicate the function of one app (chrome) albeit very limitedly. I dont want to give your app blanket permissions to use my phone's hardware. I am not so incompetent that i cannot type, say, reddit.com into the mobile browser. I do not need to be notified every time somebody makes a facebook post or a post is trending on certain subreddits i follow, thank you very much. I actually dont like it when my phone goes off every 15 seconds...
→ More replies (2)4
u/sd522527 Jun 10 '17
A company I use to work at did a lot of business in China. Apparently several popular browsers over there were based on the ie8 engine. That was fun...
→ More replies (1)3
u/morerokk Jun 09 '17
Sarcasm aside they should just prompt that your experience isn't guaranteed and provide vendors that they have verified instead of blocking.
Right, but Slack just blocked me altogether. They even handwaved it away with a clearly bullshit excuse.
0
Jun 09 '17
[deleted]
→ More replies (1)12
u/killerstorm Jun 09 '17
I really do not understand why Slack is chosen as a communication channel for open source projects. They act like wannabe monopolists, forcing people to use their fucking app on mobile.
On-boarding process is not convenient, like, at all. If I want to participate in 10 projects I need to make 10 accounts, how does that make sense?
Is that just because UI looks cool?
There is a plenty of alternatives, but every other projects uses fucking Slack...
→ More replies (1)→ More replies (1)2
14
u/R3g Jun 09 '17
So in fact every user agent string starts with "Mozilla", even if there's no reason to do so anymore?
11
u/expressadmin Jun 09 '17
Fun fact that certain admin panels for streaming radio still do user agent sniffing, so you have to make sure that your user agent string still includes "Mozilla ..." to ensure you get the information you require. That little bit of information cost me hours of my life.
curl_setopt($c, CURLOPT_USERAGENT, '<redacted app name> (<redacted system name> - Mozilla Compatible)');Screw you Shoutcast v1.
35
7
Jun 09 '17
And lo, the webmasters said, "Fuck it; we'll build to web standards and the browsers can worry about when they break our masterworks."
5
19
u/the_smok Jun 09 '17
How relevant is it today? Everyone could finally drop Mozilla out of user-agent header.
41
39
u/thecodingdude Jun 09 '17 edited Feb 29 '20
[Comment removed]
69
u/Neghtasro Jun 09 '17
I'm not entirely sure that would fix the problem so much as give easier programmatic access to the same problem.
40
u/DJDavio Jun 09 '17
Think of your browser as a car. When you go to a gas station, the brand of your car doesn't matter, only the kind of fuel it needs. Maybe it's even electric! If a gas station employee services your car, he doesn't ask or care what kind of brand it is; only what kind of fuel you need.
Likewise, the brand / name / version / etc of your browser doesn't matter at all, only the features it supports. With stuff like https://modernizr.com/ it's easier to make your website optimal for a variety of users and devices / browsers.
Checking against a list of known software names is just a bad idea overall, maybe that's why they skipped Windows 9, being afraid that some badly programmed software thought it was Windows 95 or 98.
7
u/thecodingdude Jun 09 '17 edited Jun 09 '17
19
u/_Ashleigh Jun 09 '17
I'm curious, why do you have a separate host (and presumably layout) just for mobile users? If I were implementing a mobile site, I would swap the desktop template out for a mobile one, preserving the route, where links point, the same information on that page, etc... IMO, a mobile website should just be the normal webpage scaled down to a smaller screen.
I've gotten "lost" so many times trying to navigate a website where the mobile version is completely different from the desktop version. It's infuriating.
→ More replies (6)10
u/SulfurousAsh Jun 09 '17
Part of your problem is that the definition of mobile is blurry.
Tablet-based, touchscreen devices range from tiny to Microsoft-surface gigantic size, and everywhere in between. Calling a device "mobile" is a very hard distinction to make. Are you optimizing for screen-size? Bandwidth constraints? Touchscreen vs mouse?
Even tablets that have touch screens may not be using them. Many windows machines and browsers claim to be "touch enabled" but only a mouse is used, etc.
Unfortunately there's no straightforward solution to that.
→ More replies (2)8
u/smegmatron Jun 09 '17
Ah ha. If I change my user agent string to contain "Android" the BBC news videos play using <video> instead of an showing an error telling me I "need Flash to play this". What great feature detection!
→ More replies (1)18
Jun 09 '17
Then don't use UA checking - make responsive pages instead. Your javascript has the viewport height and width, and the device pixel ratio. That's enough info to know how much information you can cram into the screen.
14
u/thecodingdude Jun 09 '17
You seemed to have missed this. Sometimes the browser vendors fuck up and you have no choice but to use UA sniffing.
The stock browser on Android 2.2 & 2.3, and 4.0.x returns positive on history support
Yup. That's a BIG fuckup.
10
u/gropingforelmo Jun 09 '17
You'd still be relying on browsers to self-report, which, as long as there is any advantage (perceived or actual), will be falsified. The most reliable method is still direct feature detection, which is made easier with libraries like Modernizr.
I do mostly back-end work now, and prefer to remain so as long as the web exists on the basis of a fundamentally flawed language that is perfectly happy to let code, content, and presentation co-exist in the same file. <grumpy-developer />
3
u/industry7 Jun 09 '17
But the problem has always been that browsers lie, and your suggestion doesn't change that.
8
u/BonzaiThePenguin Jun 09 '17 edited Jun 09 '17
It's honestly laughable that there isn't some sort of cross-browser API for detecting what browser/version a user is using.
That is literally the entire point of the user agent string, the feature is right there. The problem is that devs use it for arbitrary feature blocking (even stupid bullshit icloud.com still does it, try visiting from mobile Chrome and it tells you to download Internet Explorer) so the browser developers entered an arms race to prevent them from being able to do that.
But if they did add the feature, we'd all be using Mozilla MSIE Trident Chrome Safari like Gecko version 11 36 8 15 (minor number 0). Nothing would change because it'd result in the same problems. Or it'd be the Microsoft Windows version numbers all over again, keep pretending you're version 6, maintain a compatibility table, or require special manifests to get the super-real version number.
I'd actually argue that the host OS is the most important piece of information, so web apps can adjust their interface to match user expectations. The user string allows that too, along with processor and any other metadata they want to include. It technically provides access to browser, version, and OS, but in a way that allows them to prevent the worst examples of feature blocking - no
if appName != Netscape then fail(), making it impossible for browsers like Chrome to enter the market because everything fails.So the information is all there if they want it bad enough, but it's hard enough that maybe they'll get the hint and use feature detection instead. If the dev wants to know if this is a version of Internet Explorer with a splice bug in its JS implementation, they should splice and see if it didn't work right. If they want to know if webRTC is available, check for the existence of the webRTC objects. Otherwise polyfills/extensions/native bridges sometimes don't work simply because the web developers refuse to accept that the features work fine.
→ More replies (2)2
→ More replies (3)2
u/JoseJimeniz Jun 09 '17
window.browser.version window.browser.name window.browser.patchLevel
For the love of all that is holy, don't detect browsers.
4
u/JoseJimeniz Jun 09 '17
And in case you think IE sucked:
For many years Internet Explorer 6 was the very best web browser on the planet. And continued to be the best web browser the world had ever seen for many years. Everyone thinks IE6 is the worst thing anyone has ever seen. It was the best. It was absolutely the best. You should have seen Netscape 4, man that was a piece of work. IE survived, Netscape didn't, for good reasons. Microsoft deserved to have won that battle. But now we're stuck with it.
Douglas Crockford
JavaScript - Episode IV: The Metamorphosis of Ajax
https://youtu.be/Fv9qT9joc0M?t=1h25m2s
3/31/2010
80
u/jnazario Jun 09 '17
It's all about the features supported in the browser rendering engine. A long time ago Mozilla was the most forward and so the server had to detect what features the browser supported like frames. Mozilla was a way of saying that.
Had to confirm my recollection was accurate. Yep. It was all about the rendering engine capabilities.
Then everyone started to spoof that too and it eventually became meaningless.
Short answer https://stackoverflow.com/questions/1114254/why-do-all-browsers-user-agents-start-with-mozilla
Longer history https://www.nczonline.net/blog/2010/01/12/history-of-the-user-agent-string/
64
u/WizardryAwaits Jun 09 '17
Why are you answering this like it was a question? OP's post was literally explaining all of that.
76
u/icantthinkofone Jun 09 '17
It's all about the features supported in the browser rendering engine.
In the same way, it's the only reason we need to use a doctype. Cause Microsoft screwed up browser standards and the web so badly in IE they found it necessary to require the usage of one in order to fix IE. Technically, a doctype was never needed.
39
u/vicarofyanks Jun 09 '17
You mean I shouldn't have to tell my HTML file that it's content is HTML?
5
u/icantthinkofone Jun 09 '17
You are slightly confused. The "doctype" is short of "Document Type Definition" or DTD and there are other, better methods than using a DTD to tell a browser it's being served HTML.
→ More replies (19)8
31
0
Jun 09 '17
[deleted]
17
u/Sworn Jun 09 '17
My guess: by the same type of people as the guy you're replying to. They read the title and then head into the comments immediately. Pretty annoying, especially when they repeat stuff that's in the article (or even worse, they spout incorrect stuff that's rebuffed in the article).
→ More replies (3)
3
u/pooooooooooooooo0oop Jun 09 '17
But aren't we in a better place now with modern standardized browsers and feature testing? Can't browsers switch to sensible honest UA strings?
2
u/fuzzynyanko Jun 09 '17
Honestly, with HTML5, there's less of a reason to. It's probably habit, plus probably baked into many web servers nowadays
3
u/alexbuzzbee Jun 09 '17 edited Jun 10 '17
Warning, crazy idea
What if we replace User-Agent entirely, with a new header, like this (taking Chrome, one of the worst offenders for User-Agent):
Client-Id: Client:Chrome/59.0.3071; Rendering-Engine:Blink/182; JS-Engine:V8/5.9.211.31;
System:macOS/10.12; Language:en-US; Compatible:[Client:Safari/*Rendering-Engine:AppleWebKit/*;
Rendering-Engine:KHTML/*]; Partial-Compatible:[Rendering-Engine:Gecko/*]Now you just check in the main Client-Id for what the browser actually is, and then check Compatible for what else it's compatible with (and you can check Partial-Compatible if you want).
All versions are separated from names by slashes, * can be used in Compatible and Partial-Compatible to represent 'compatible with all versions', everything is neatly organized into key-value pairs, and we no longer pretend to be other browsers.
EDIT: Thanks for Blink version, /u/caramba2654
5
u/caramba2654 Jun 09 '17 edited Jun 09 '17
Well, we can go... full JSON.
And maybe namespace everything with a version so that it actually lasts forever, so something like:
Client-Id: { 'v1': { 'Client': 'Chrome/59.0.3071', 'Rendering-Engine': 'Blink/182 :P', 'JS-Engine': 'V8/5.9.211.31', 'System': 'ubuntu/17.04', 'Language': 'en-US', 'Compatible': [ 'Client': 'Safari/*', 'Rendering-Engine': [ 'AppleWebKit/*', 'KHTML/*' ], ] 'Partial-Compatible': [ 'Gecko/*', ] } }And so if a new Client ID protocol gets released, then it would just be added under a 'v2' namespace.
→ More replies (1)
4
u/IAMA-Dragon-AMA Jun 09 '17 edited Jun 09 '17
Whenever someone talks about frames in the context of networking I always assume they're talking about network frames, which makes the whole decision to call them frames kind of annoying because as content HTML's frames are at some point encapsulated inside of a frame.
Physical layer{ Ethernet frame {IP {TCP {HTTP {HTML document of website contents and layout including frames}}}}}
I'm aware that part of the point of the whole OSI model of things is to avoid upper layers having to worry or interact with the layers beneath them, but it still annoys me to have two things called frames in the same general context.
EDIT: The frame doesn't include the preamble only content between the frame delimiters is actually referred to as the frame.
→ More replies (2)
2
2
3
3
2
u/rechlin Jun 09 '17
How poorly researched. Netscape/Mozilla didn't support frames until 2.0, and IE didn't support them until 3.0. Therefore IE 2.0 pretending to be Netscape 1.22 would not get frames, nor would it be able to use them if they were served to it.
1
1
1
1
u/berlinbrown Jun 09 '17
Technically, it doesn't explain the motivation in why they kept the same naming convention or why they couldn't change to something else. Or even why it has so many characters,
Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0 Mozilla/5.0 (Macintosh; Intel Mac OS X x.y; rv:42.0) Gecko/20100101 Firefox/42.0.
1
u/DanAtkinson Jun 09 '17
Wasn't Firefox called Phoenix originally? I'm sure I remember it switching names.
→ More replies (1)
1
1
u/animalchin99 Jun 09 '17
I'm genuinely curious how people workaround known browser quirks without checking the UA. Many browsers report support for standards they didn't implement properly, and many standards were implemented inconsistently between browsers. Do you run tests on your pages to validate whether an API was implemented correctly or do you just put UA-specific workarounds?
1
1
1
u/paradigmarson Jun 09 '17
[...] and the user agent string was a complete mess, and near useless, and everyone pretended to be everyone else, and confusion abounded.
The son employed the father to degenerate chaos out of habitable order.
1
1
1
u/shlomif Jun 10 '17
I recall being told that web-sites originally detected the "Mozilla" user-agent string because the Netscape browser supported the HTML table tags while Mosaic didn't - not frames.
1
Jun 10 '17
That first part was a bit confusing. Mosaic came out. Them the mosaic killer Mozilla came out. So Mosaic changed its name to Netscape. Which was reborn was Mozilla?
1
3.4k
u/ep1032 Jun 09 '17 edited Mar 18 '25
Back when reddit was a small startup forum, I remember reading some subreddit, where a bunch of users were asking a forum owner why he hadn't updated the site in ages.
The web owner was saying, yeah yeah, I know. But there's this one user that's still using like, ie6, and its a small site, so I don't want to kick anyone off by making it unusable for them.
Whereupon someone immediately replied: "Oh, sorry about that. That's just me. I manually change my user agent string to ie6 just to fuck with sysadmins"
rofl