不支持高版本主要原因是$.browser #8

Open
cipchk opened this Issue Oct 1, 2014 · 0 comments

Projects

None yet

1 participant

@cipchk
cipchk commented Oct 1, 2014

以下是我对源代码的修改,或许可以帮到你。

var agent=navigator.userAgent.toLowerCase(),
    browserMath = /(chrome)[ \/]([\w.]+)/.exec( agent ) ||
    /(webkit)[ \/]([\w.]+)/.exec( agent ) ||
    /(opera)(?:.*version|)[ \/]([\w.]+)/.exec( agent ) ||
    /(msie) ([\w.]+)/.exec( agent ) ||
    agent.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec( agent ) ||
    [],
    browser = {};
if ( browserMath ) {
    browser[ browserMath.browser ] = true;
    browser.version = browserMath.version;
}
// Chrome is Webkit, but Webkit is also Safari.
if ( browser.chrome ) {
    browser.webkit = true;
} else if ( browser.webkit ) {
    browser.safari = true;
}

var bMobile=/mobile/i.test(agent),
    browerVer=parseFloat(browser.version),
    isIE=browser.msie,
    isMozilla=browser.mozilla,
    isWebkit=browser.webkit,
    isOpera=browser.opera,
    isChrome=browser.chrome,
    bAir=agent.indexOf(' adobeair/')>-1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment