To address some browser-specific behavior, namely Firefox 23, among other’s, Mixed Content Blocking, I was asked to browser sniff, then set the HTML accordingly. It assured—note my gritted teeth—the view rendered the relevant message. Yes, there are other methods, as there always are, but this was what worked for our circumstances and constraints.
So, since I had to do the wrong thing, I decided to do it the right way. It’d been a while since I had to check a user agent string, so I Google’d and otherwise searched for any progress that might have been made on the topic or if, by some miracle of the web gods, there was now a better way to address browser-specific behavior. There was no such miracle, but below are the best links among my web findings*. These resources represent the recent discussions on User Agent sniffing and how to do it.
I welcome suggestions on other resources.
*The list here leans a tad toward Firefox, since that was what started the search. Plus Mozilla's Developer Network is just awesome.
Valuable lesson from Matt Urban:
Always stage it on the same server as production.
Man, that’s a life-saving move right there.
To be forthright, in the late hours of the night, when IE won’t do as I’ve commanded, I’ve cursed IE users. But I always feel bad about it afterward. They might not have a choice. So, I do penance by making sure they have a proper experience. Meanwhile, some web developers express a disturbing amount of disdain for the user, and it goes beyond the user’s choice browser. From articles’ comment sections to Facebook to forums, and worst of all, in real life, I come across feelings like these:
Like little kids, users want it all. They don’t care who pays for it, as long as it’s not them. They don’t care how it gets to them, as long as it’s there when they want it. And they always want it now, right now! They’re leeches!
Actually, that’s a toned down version of some of the minor jabs and outrageous rants from some people calling themselves web developers. While there’s usually another developer around—or a few hundred—to politely or otherwise scold that commenter, I nevertheless question why these anti-users develop. Don’t we develop for the user? We’re designing user interfaces and building applications in hopes the users will return.
James Somers asks “Are Coders Worth It?” and further complicates this matter by portraying a world of “mediocre programmer[s].” He reminds me there’s a community of developers coding just for the money or the label, learning the languages without understanding the web cannot be gamed into a pretty product that didn’t consider them. Before reading this article, I thought these apathetic coders were a minority. But I’m starting to wonder if the art in programming is dying out as we watch basic coding become the cool thing to learn. The “anyone can code” song we trumpet will distort into a dirge if we, as a web community, don’t emphasize the difference between coding and programming. Anyone can code the way anyone can paint. Most of us are not the next Picasso of programming, but if we’re worthy of our computers and our titles as web developers, we’re working toward the mythic perfect iteration.