Updated: Better iPad Handling, Improved Windows Mobile Detection
I just uploaded the code bases for the following issues:
- In the DetectIphone() method, added a call so that the Apple iPad does not provide a false positive. (We also do this so that iPod Touches don’t report themselves as iPhones.)
- In the QuickMobile() method, added a call for the iPad so that iPads do not report as TRUE. Why do this? Instead, if you want to provide a special UI design for iPads (such as special layouts or to remove Flash), then make an explicit call using the new DetectIpad() method. Otherwise, let the iPad visitors get your regular web site rather than a site optimized for a small mobile phone’s screen.
- In the DetectWindowsMobile() method, added some new calls. One call checks for “ppc”, which is an indicator of Windows Mobile Professional (aka PocketPC) and is often the only clue for many such devices. The other call looks for both “HTC” and “Windows”. Many HTC Windows Mobile Professional devices try to pass for regular PCs, so this seems to be the best technique for sniffing (most of) them out.
I’ve already uploaded the code to the Google code repository. Please let me know if you spot any bugs!
UPDATED (June 6, 2010): Thanks to Tony, we discovered that the initial enhancement to detect PocketPC (“PPC”) in the DetectWindowsMobile() method also accidentally caught Macintosh PowerPC browsers. So I did a quick update today based on the suggestions which ought to hopefully disambiguate the desktop Macs.