4 ms·
> In fact, I recommend that browsers ignore these hints because they are wrong much of the time. I don't agree. That's the kind of coddling that encourages in
by ryan29 5y ago
> In fact, I recommend that browsers ignore these hints because they are wrong much of the time.
I don't agree. That's the kind of coddling that encourages incompetence. Instead of compensating for others' mistakes, just let their stuff break.
I wonder if Safai on iOS ignores the hints. When I tested, I was surprised to see that pressing the share icon, which holds the option for `Add to Home Screen`, would cause a download of all of the icons listed with `link rel="icon"`.
Favicons are a huge pain to deal with correctly.
- ehsankia 5y agoThat may be your viewpoint but browsers have historically always taken the other viewpoint. Take HTML parsing for example. You can miss closing tags and a ton of other stuff, and it'll all work on a best-effort basis. The browsers job is to do the best it can, that's what users want. No one would use a browser that breaks at the smallest tiniest error in the source code.
- adamrezich 5y ago> browsers have historically always taken the other viewpoint. except for the short-lived XHTML fad which tbh I kind of miss every day
- vbezhenar 5y agoXHTML is still supported and works even with HTML5 tags.
- sokoloff 5y agoI don’t see Postel’s Law cited here yet, which I find pragmatic and worth sharing/considering as I used to be in the “let their stuff break” camp. https://en.m.wikipedia.org/wiki/Robustness_principle https://en.m.wikipedia.org/wiki/Robustness_principle (Quite short)
- paxys 5y agoBrowsers ignore the hints because they aren't needed. The image file itself has everything you need for rendering it.
- ygra 5y agoThe point for the hints is probably that the browser doesn't need to fetch the 2000×2000 favicon if it only needs something in 16×16 to render in the tab bar.
- malfist 5y agoPeople make mistakes all the time. Breaking because somebody made a mistake that you can correct for just leads to unnecessarily fragile code. What's the point of failing and breaking stuff if someone tells you their image is 144x144 but it's really 145x145? Who does that benefit?
- anyfoo 5y agoThe opposite is the case. Overall, being too lenient in what code accepts and applying heuristics will lead to way worse problems down the line. For example, you want your compiler to fail hard instead of saying: "Oh, this isn't a pointer, but I'm sure you meant well, I'm just going to treat it as a pointer!" In this particular case, it seems to me that the hints serve no purpose and should be abolished, and in the meantime fully ignored, altogether. All necessary metadata is contained in the image file, and browsers should also be (relatively) strict in what image files with what metadata they accept, for security reasons alone. And if they also went so far as limiting file size, the perpetrators that clog up bandwidth by putting up multi-MB favicons would catch on much earlier (or at all), too. So what actually is the point of those hints, if browsers have to fallback anyway?
- notatoad 5y agoThe hints are not a hint in how to render the icon - browsers don't need hints for that. the hints are an instruction to browsers on which icon to download in the case where multiple icons are specified. if you are safari and you don't know how to display SVG favicons, then you don't need to waste bytes downloading a favicon only to fail to display it. the HTML does not limit a site to only one favicon.
- anyfoo 5y agoWhy is that not done through the MIME type and using HEAD? The server is apparently much better able to figure out the MIME type through magic numbers and file extensions of the actual file, than the author (human or not) of the HTML, as we see. The same headers also inform the browser that they can skip downloading a favicon that they consider too big, for example.
- Conlectus 5y agoA problem with this is that when a website breaks in one browser, but works in another, I imagine most people's reaction would be to blame the browser. This leads to a kind of race-to-the-bottom for browser compatibility. See for example the history of User-Agent strings.
- jiggunjer 5y agodepends on the error message? Maybe instead of failing, give an annoying prompt to offer a workaround.
- iudqnolq 5y agoYouTube and Twitter both have wrong parameters. Presumably this means all major browsers ignore them or someone would have noticed their favicons not displaying right?