I would prefer the following detection algorithm:
1. Look for the exact match, e.g. "Mozilla/5.0 (iPad; U; CPU OS 4_3_3 like Mac OS X; en-gb) AppleWebKit/533.17.9 (KHTML, like Gecko) Mobile/8J2"
2. If not found, ignore any non-device related options like "en-gb" and fallback to "Mozilla/5.0 (iPad; U; CPU OS 4_3_3 like Mac OS X; XX-XX) AppleWebKit/533.17.9 (KHTML, like Gecko) Mobile/8J2"
3. If not found then fallback to a generic mobile device with particular OS, e.g. to "Mozilla/5.0 (iPad; U; CPU OS 4_3_3)"
4. If not found then fallback to a generic mobile device with default OS, e.g. to "Mozilla/5.0 (iPad;)"
5. If not found then fallback to a specific desktop browser, e.g. Safari
6. If not found then fallback to a generic desktop browser
Maybe, a lot of that have been already done, so we've almost there.
|
|