What Is User-Agent detection?

Remember the world before Firefox?

To some of you, this will be ancient history, but I hope I’m not the only one who remembers the bad old days. There was Netscape and Internet Explorer. Netscape died a very noisy death, there was something about anti-trust, but no one really cared. After all, Internet Explorer was better by far, it was free, and it came with your computer.

“Standards” were a joke. No browser implemented them correctly, and your best bet — what everyone was doing anyway — was to just develop for IE, slap a “Works best in IE6 at 1024×768” on the bottom of the page, and call it a day.

As soon as this happened, Microsoft stopped innovating. IE6 was better than Netscape, sure, but how high a bar is that? Other browser existed, sure. Mozilla was quietly improving — just a little bit faster, just a little bit smarter, a few more features here and there, just a little bit better at dealing with “designed for IE” pages…

Then Firefox was born. Taking the best parts of Mozilla and turning them towards the singular goal of making the Web experience better, Firefox took the lead as the first web browser to seriously challenge “Works Best in IE.” IE didn’t have tabbed browsing; Firefox did. IE may have had ActiveX controls and toolbars, but Firefox turned extensibility into an art form. Best of all, people actually started to use Firefox.

It was a painful transition, however. “Works Best in IE,” while it made the developers’ job easier, infuriated a larger and larger group of Web users who were using Firefox. Despite this, Firefox has won — IE’s market-share is now below 50%, which means any website still using “Works Best in IE” is admitting that it either has not been updated since the 90’s, or is willing to deliberately exclude over half of its potential visitors because of a browser choice.

And yet, even today, there are websites which aren’t content to slap a “works best in” label on their page and call it a day. There are websites which actively block browsers they don’t recognize.

The best of these will detect supported features via JavaScript, and disable those features on non-compliant browsers — but at least a savvy user could view the source and figure out what the page was doing differently. Sometimes it really is the browser that’s wrong — perhaps a developer will open some developer tools and find out why the page doesn’t work, and either tell the website how to fix it, or submit a patch to their favorite browser. That’s fine — this is how progress is made.

But some websites will use tools like User-Agent detection on the server side to outright not deliver the code for certain features, or disable the page entirely, if an “incompatible” browser is detected. To even view the source for such a page and determine what about it requires a specific version of a specific browser, we must first engage in User-Agent spoofing.

This is at best an inconvenience, but at worst, it is actually immoral. The inspiration for this website was the online version of the Free Application for Federal Student Aid, which denies me access to a government service — a service which is my right as a citizen — because I am not using the correct browser. To add insult to injury, the page it sends me instead lectures me on web standards and using an up-to-date browser, when the browser it blocked was a newer (and more standards-compliant) version of one they support.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s