Detect Metro UI Version of IE

后端 未结 11 1797
轻奢々
轻奢々 2020-12-02 21:22

What\'s the fastest method, to detect User-Agent as metro UI version of internet-explorer >=10 ?

11条回答
  •  醉酒成梦
    2020-12-02 21:33

    var _ua = window.navigator.userAgent;
    var isIDevice = (/iphone|ipod|ipad/i).test(_ua);
    var isMobileChrome = (_ua.indexOf('Android') > -1 && (/Chrome\/[.0-9]*/).test(_ua) && _ua.indexOf("Version") == -1);
    var isMobileIE = _ua.indexOf('Windows Phone') > -1;
    function isActivexEnabled()
    {
        var supported = null;        
        try
        {
            supported = !!new ActiveXObject("htmlfile");
        } 
        catch (e) 
        {
            supported = false;
        }
        return supported;
    }
    if (!isIDevice && !isMobileChrome && !isMobileIE &&  _ua.toLowerCase().indexOf("wow") == -1 && !isActivexEnabled())
    { 
        //IE Metro UI
    }
    

    This Work For Me..

提交回复
热议问题