3 ms·
Once upon a time it was considered a great strategy for browsers to make the best effort to display a page, even if the html code had errors. Just try to guess
by lucianbr 3y ago
Once upon a time it was considered a great strategy for browsers to make the best effort to display a page, even if the html code had errors. Just try to guess the author's intention as well as you can, and go ahead. Errors are bad. Users don't want errors.
I thought we learned from that experience. Apparently not.
- debacle 3y ago"We" did. Microsoft didn't. Not unexpected.
- subarctic 3y agoWhat did you think we learned?
- lucianbr 3y agoThat every single behavior that attempts to guess the users's intent becomes a relied upon part of the software, and this over time grows to an impossible amount of cruft. See this, hilariously hosted also by microsoft: https://techcommunity.microsoft.com/t5/discussions/funny-story-of-browser-wars-from-the-beginning-of-the-time-user/m-p/1079832 https://techcommunity.microsoft.com/t5/discussions/funny-sto... > And then Google built Chrome, and Chrome used Webkit, and it was like Safari, and wanted pages built for Safari, and so pretended to be Safari. And thus Chrome used WebKit, and pretended to be Safari, and WebKit pretended to be KHTML, and KHTML pretended to be Gecko, and all browsers pretended to be Mozilla, and Chrome called itself Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Chrome/0.2.149.27 Safari/525.13, and the user agent string was a complete mess, and near useless, and everyone pretended to be everyone else, and confusion abounded.
- eastbound 3y agoIn 2024, so we still have websites that are served differently depending on the User Agent? Could we possibly do away with the User-Agent header, or reset it to a simple “Chrome 150.01”?
- xp84 3y agoMeh. For all the silliness, it’s not that hard to parse one for the main purpose it should be used for, which is determining in aggregate what platforms your users use. As such, we still need things like OS in there anyway. So it wouldn’t get quite that short. Also I’m amused checking mine that the user agents still say “Intel Mac OS X” even on Apple silicon. I guess they were afraid someone’s parser would think we are on PowerPC without that!
- KTibow 3y agoI vaguely remember plans to make the user agent simpler but I can't find anything that matches with some quick web searching. The most relevant article I could find was from 2013: https://hacks.mozilla.org/2013/09/user-agent-detection-history-and-checklist/ https://hacks.mozilla.org/2013/09/user-agent-detection-histo...
- dwattttt 3y agoTry google.com, last month: https://support.google.com/websearch/thread/252500737/google-search-broken-using-firefox-android-user-agent?hl=en https://support.google.com/websearch/thread/252500737/google...
- lucianbr 3y agoLook at all the comments insisting that the way Microsoft does it is the correct, superior way. How could we do away with it then?
- kentonv 3y agoBrowsers still follow that strategy. The effort to replace it with strict validation (XHTML) failed. What succeeded instead was HTML5, which went back and explicitly defined how every possible invalid sequence should be interpreted, so that browsers would at least be consistent about it.
- imperfectsoft 3y agothe evolution we have seen in software in the last 20 years isn't great except for LLMs, but then again, they messed them up with censorship. I would not miss much if I was time-traveled to 1999.
- wvenable 3y agoBrowsers being permissive with what they accept is what made the modern web possible. If early browsers displayed an error the first time it came across an <img> tag, instead of just best-effort rendering the page, then every new browser feature would have been smothered in the cradle.
- _gabe_ 3y agoGo type in: <p>Hello <br></br> World! And see the errors that now show up because of the wisdom we gained… wait, it still renders alright? I guess we still have much to learn then. Or, there might be something to gracefully handling certain classes of errors while crashing on exceptional cases.
- pests 3y agoNot sure if you meant to use <p> as an example because it's well-defined as an optional closing tag. This is a completely normal usage and some people even author their HTML like this. Granted this is part of the effort to standardize error handling. That unclosed <p> will auto-close as soon as you start another paragraph or close it's parent element. Likewise this is how I do lists these days: <ul> <li> One <li> Two </ul> The subsequent li's will close the previous and the bounding ul ends the last list item.