New IE9 Windows Phone Mango User Agent String revealed
With Windows Phone Mango devices starting to hit commercial availability worldwide, Microsoft is urging web developers to adapt their sites for the new mobile flavor of Internet Explorer 9.Mozilla/5.0 (compatible; MSIE 9.0; Windows Phone OS 7.5; Trident/5.0; IEMobile/9.0; <manufacturer>; <model> [;<operator]) is the new User Agent string for IE9 on Mango, revealed Charles Morris, program manager lead, Windows Phone, noting that devs will be able to spot a few differences, compared to the WP7 IE.
‘Mozilla/4.0’ has become ‘Mozilla/5.0’, ‘MSIE 7.0’ is now ‘MSIE 9.0’ and ‘Trident/3.1’ was updated to ‘Trident/5.0’, with ‘IEMobile/7.0’ becoming ‘IEMobile/9.0’.
Additional details such as operator and device model will be populated automatically, the Redmond company explained.
Still, the software giant is pleading with web developers not to leverage the UA string for browser detection.
“You should not rely on it to target specific functionality. Instead, use feature and behavior detection to detect specific browsers wherever possible,” Morris said.
“If you do decide to use UA detection, we suggest using the “IEMobile” token to identify Internet Explorer on Windows Phone as a mobile browser. If you would like to target modern markup at IE9 (and future versions of IE) on Windows Phone, you use a regular expression to extract the IEMobile version token then check if it is greater than or equal to 9.0.”
Of course, those sites that do leverage UA string detection to detect Windows Phone devices will need to be updated with the new info provided by Microsoft, by removing the old WP7 UA string and replacing it with the new Mango UA string.
“If you have a tiered experience based on browser capabilities, now is a great time to start enabling richer functionality (e.g. HTML5 video) for IE9 on Mango devices. If you are using feature detection, some of this should happen automatically but be sure to grab the emulator or upgrade your developer devices to double-check,” Morris added.