jacklone / browserscope

Automatically exported from code.google.com/p/browserscope
Apache License 2.0
0 stars 0 forks source link

better IE9 identification #237

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Right now we classify IE9 platform preview as "IE 9.0". Unfortunately, the UA 
string doesn't have good info to better classify it, but here's some JS that 
dos the job.

Can we deploy this logic for better identification going forward?
Is there a way to relabel all "IE 9.0" now as something like "IE 9.0 preview"? 
(Since only previews have been released.)

if (_isAnyIE && typeof document.documentMode != 'undefined') {
    if (window.external == null) {
        _isPP = true;
        if (typeof Array.prototype.indexOf != 'undefined')
            _isPP3 = true;
        else if (typeof document.getElementsByClassName != 'undefined')
            _isPP2 = true;
        else
            _isPP1 = true;
    }
    else if (document.documentMode == 9) {
        if (window.navigator.appMinorVersion.indexOf("beta") > -1)
            _isIE9Beta = true;
        else
            _isIE9 = true;
    }
    else {
        _isIE8 = true;
    }
}

Original issue reported on code.google.com by stevesou...@gmail.com on 22 Jul 2010 at 4:35

GoogleCodeExporter commented 8 years ago
slamm has done some work with passing other bits in via Javascript to help with 
UA classification, so I'll take a look at that. 

Original comment by els...@gmail.com on 22 Jul 2010 at 9:03

GoogleCodeExporter commented 8 years ago
Fixed in r674 - this is a bit of an overhaul for how we handle js-detection as 
a generic override for our server side ua parsing. This allows a per-value 
override, meaning we can override family, v1, v2, v3. Knowing any one thing is 
not enough (i.e. documentMode) to distinguish the flavors of some browsers, and 
this will help us going forward to generically solve this problem in JS

Original comment by els...@gmail.com on 7 Aug 2010 at 1:52