GET STARTED DEVELOPING FOR WINDOWS 8 WINDOWS PHONE AZURE WITH APP BUILDER
Many web programmers use the User-Agent field in the request header to identify what operating system, browser, and browser capabilities are coming at their programs. The User-Agent helps characterize the client so appropriate customizations can be rendered.
Windows Phone "Mango" brings a new HTML5 browser based on IE9. So what should web developers be expecting in terms of the user agent?
The general format of the user agent string is as follows: Mozilla/5.0 (compatible; MSIE 9.0; Windows Phone OS 7.5; Trident/5.0; IEMobile/9.0; MANUFACTURER; DEVICE) Where MANUFACTURER and DEVICE are replaced by, well, the actual manufacturer and device.
Note the OS version in the User-Agent is 7.5. Even though running System.Environment.OSVersion yields "Windows CE 7.10.7712". Ducking and covering less another kevin-rant come my way on that one.
The Windows Phone "Mango" Emulator yields the following User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows Phone OS 7.5; Trident/5.0; IEMobile/9.0; Microsoft; XDeviceEmulator)
A Dell Venue Pro running on "Mango" offers up the following User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows Phone OS 7.5; Trident/5.0; IEMobile/9.0; DELL; Venue Pro)
Here is the User-Agent for Windows Phone 7.0 for you to compare to (off my daughter's DVP): Mozilla/4.0 (compatible; MSIE 7.0; Windows Phone OS 7.0; Trident/3.1; IEMobile/7.0; DELL; Venue Pro)
For reference, the code I used to render the User-Agent strings is below, along with screen shots from the emulators and devices. Enjoy.
<div id="useragent"></div><br />
document.getElementById("useragent").innerHTML = navigator.userAgent;
Something I found out the hard way with one of my apps... if you have an app that uses the WebBrowser control that compiled to "7.0" and you're running it unmodified on "Mango", the control will still use the IE7 UserAgent string, not the IE9 one. You have to recompile to Mango to get the IE9 UA.
Robert, agreed. If I run my windows phone 7 tacklebox unaltered and deploy to mango device or emulator, i get the wp7 ua strings, not the mango ones.