What Looks Like IE11 but Smells Like Firefox?

A pre-release build of Windows Blue, Microsoft’s successor to Windows 8, was leaked a few days ago. It may have been intentional or unintentional but the OS was installed, dissected and reported across the web.

The new OS contained an early version of Internet Explorer 11. A very early version. Probably nearer IE10.01. There’s little new technology to report, but one update caused a storm of controversy on SlashDot and Neowin.net: IE11’s user agent string appears to impersonate Firefox…

Browser Y is then updated — but the website now fails because it’s serving legacy code.

The vendor changes the user agent string: detection fails and the site works again. Everyone is happy and we loop back to step one.

Look at the start of IE11’s user agent string: Mozilla/5.0. The early versions of IE had to masquerade as Netscape because it was the dominant browser and many sites refused to return content to anything else. The situation continues today — IE, Chrome, Safari and Firefox all start with ‘Mozilla/5.0’…

You’ll also notice both Chrome and Safari use the same ‘like Gecko’ string as IE11. I don’t recall that bombshell hitting the headlines?

The biggest change in IE11 is the removal of ‘MSIE’. I suspect that has been done for one reason: to prevent sites serving invalid IE6/7/8 code to modern editions of the browser. Recent releases of IE’s Trident engine are closer to Gecko or WebKit than legacy editions of itself. By removing the ‘MSIE’ string, Microsoft is breaking detection code and making many sites work as they should.

The point is: none of this matters. If you’re browser sniffing, you are almost certainly doing something wrong! While it seems an obvious solution, browser sniffing is a fragile technique that introduces more maintenance headaches than it prevents. If you know someone who sniffs, please suggest they close their IDE, step away from their browser and embark on another career.

Craig is a freelance UK web consultant who built his first page for IE2.0 in 1995. Since that time he's been advocating standards, accessibility, and best-practice HTML5 techniques. He's written more than 1,000 articles for SitePoint and you can find him @craigbuckler