pgwbrowser.js
function() {
            var userAgent = pgwBrowser.userAgent.toLowerCase();

            // Check browser type
            for (i in osData) {
                var osRegExp = new RegExp(osData[i].identifier.toLowerCase());
                var osRegExpResult = osRegExp.exec(userAgent);

                if (osRegExpResult != null) {
                    pgwBrowser.os.name = osData[i].name;
                    pgwBrowser.os.group = osData[i].group;

                    // Version defined
                    if (osData[i].version) {
                        setOsVersion(osData[i].version, (osData[i].versionSeparator) ? osData[i].versionSeparator : '.');

                    // Version detected
                    } else if (osRegExpResult[1]) {
                        setOsVersion(osRegExpResult[1], (osData[i].versionSeparator) ? osData[i].versionSeparator : '.');

                    // Version identifier
                    } else if (osData[i].versionIdentifier) {
                        var versionRegExp = new RegExp(osData[i].versionIdentifier.toLowerCase());
                        var versionRegExpResult = versionRegExp.exec(userAgent);

                        if (versionRegExpResult != null && versionRegExpResult[1]) {
                            setOsVersion(versionRegExpResult[1], (osData[i].versionSeparator) ? osData[i].versionSeparator : '.');
                        }
                    }

                    break;
                }
            }

            return true;
        }
function() {
            var userAgent = pgwBrowser.userAgent.toLowerCase();

            // Check browser type
            for (i in osData) {
                var osRegExp = new RegExp(osData[i].identifier.toLowerCase());
                var osRegExpResult = osRegExp.exec(userAgent);

                if (osRegExpResult != null) {
                    pgwBrowser.os.name = osData[i].name;
                    pgwBrowser.os.group = osData[i].group;

                    // Version defined
                    if (osData[i].version) {
                        setOsVersion(osData[i].version, (osData[i].versionSeparator) ? osData[i].versionSeparator : '.');

                    // Version detected
                    } else if (osRegExpResult[1]) {
                        setOsVersion(osRegExpResult[1], (osData[i].versionSeparator) ? osData[i].versionSeparator : '.');

                    // Version identifier
                    } else if (osData[i].versionIdentifier) {
                        var versionRegExp = new RegExp(osData[i].versionIdentifier.toLowerCase());
                        var versionRegExpResult = versionRegExp.exec(userAgent);

                        if (versionRegExpResult != null && versionRegExpResult[1]) {
                            setOsVersion(versionRegExpResult[1], (osData[i].versionSeparator) ? osData[i].versionSeparator : '.');
                        }
                    }

                    break;
                }
            }

            return true;
        }
function ( ) { var userAgent = pgwBrowser . userAgent . toLowerCase ( ) ; // Check browser type for ( i in osData ) { var osRegExp = new RegExp ( osData [ i ] . identifier . toLowerCase ( ) ) ; var osRegExpResult = osRegExp . exec ( userAgent ) ; if ( osRegExpResult != null ) { pgwBrowser . os . name = osData [ i ] . name ; pgwBrowser . os . group = osData [ i ] . group ; // Version defined if ( osData [ i ] . version ) { setOsVersion ( osData [ i ] . version , ( osData [ i ] . versionSeparator ) ? osData [ i ] . versionSeparator : '.' ) ; // Version detected } else if ( osRegExpResult [ 1 ] ) { setOsVersion ( osRegExpResult [ 1 ] , ( osData [ i ] . versionSeparator ) ? osData [ i ] . versionSeparator : '.' ) ; // Version identifier } else if ( osData [ i ] . versionIdentifier ) { var versionRegExp = new RegExp ( osData [ i ] . versionIdentifier . toLowerCase ( ) ) ; var versionRegExpResult = versionRegExp . exec ( userAgent ) ; if ( versionRegExpResult != null && versionRegExpResult [ 1 ] ) { setOsVersion ( versionRegExpResult [ 1 ] , ( osData [ i ] . versionSeparator ) ? osData [ i ] . versionSeparator : '.' ) ; } } break ; } } return true ; }
Set OS data
Set OS data