File Under: Browsers, Mobile

Get to Know Your New User Agent Strings

With the two most-popular web browsers ready to drop new versions within the next couple of months, you’re going to have to adjust a few twiddly bits on your website if you’re sniffing user agent strings. Of course, you should be sniffing for capabilities and not blocking browsers, but nonetheless, it’s helpful to see what the new strings look like.

Internet Explorer 9

Microsoft’s new browser, due in September, has a new UA string. Details are on the IE blog, but here it is:

Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)

Firefox 4

Likewise, the new version of Firefox — version 4 is due October-ish — will have an updated UA string. Unlike IE, Firefox runs on several platforms, so there are a few:

Mozilla/5.0 (Windows NT 6.1; rv:2.0.1) Gecko/yyyymmdd Firefox/4.0.1
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0.1) Gecko/yyyymmdd Firefox/4.0.1
Mozilla/5.0 (X11; Linux i686; rv:2.0.1) Gecko/yyyymmdd Firefox/4.0.1

Easy enough to decipher. The “year month date” part is where the Gecko build id will show up. This build id will be different for each platform. Mozilla developer Daniel Witte covers the changes in depth on his blog. There’s also a more complete reference on the Moz Dev Center wiki.

Mobile browsers

Both Mozilla and Microsoft have new mobile browsers in development. Firefox Mobile was once known by the codename Fennec, so the mobile UA string is the same as desktop Firefox, but it has Fennec/fennecversion appended at the end.

The new IE mobile UA string is:

Mozilla/4.0 (compatible; MSIE 7.0; Windows Phone OS 7.0; Trident/3.1; IEMobile/7.0; <DeviceManufacturer>;<DeviceModel>)

There are more details on the Windows Phone IE blog.

All this talk of strings gives me the itch to hear a little “Foggy Mountain Breakdown.”


See Also: