Detect Metro UI Version of IE

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

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

11条回答
  •  Happy的楠姐
    2020-12-02 21:45

    METRO IE never supports ActiveX or any plugin objects. Based on that the following script is tested & working fine.

    //---------------------------Metro IE check-------------------------
        var errorName = null;
        function isBrowserSupportPlugin() {
            var supported = null; 
            try {
                new ActiveXObject("");
            }
            catch (e) {
                // FF has ReferenceError here
                errorName = e.name; 
            }     
            try {
                supported = !!new ActiveXObject("htmlfile");
            } catch (e) {
                supported = false;
            }
            if(errorName != 'ReferenceError' && supported==false){
                supported = false;
            }else{
                supported =true;
            }
            return supported;
        }
    //----------------------------------------------------------------   
    

提交回复
热议问题