javascript - Internet Explorer 11 detection -
I know that IE 11 has different user agent strings than all other IEs
Mozilla / 5.0
< P> Live !! Navigator.userAgent.match (/ trident \ / 7 \ ./) But I'm getting the error the object is not found and it needs to be re-evaluated . Then I opened the Developer Console in IE 11 and tried to reach some predefined Javascript objects, I still get the same error.
I have tried
Navigator.UGGent window.navigator < P> console.log ('test'); Anyone have any ideas about this?
Edit on November 18, 2016 The code also works ( for those who prefer another solution, without using ActiveX ) varIEE 11 = !! window. MS InputMetchContact & amp; !! Document.documentMode; Incorrect Basic Answer
on IE11 / IE and other IE / Browsers, you can use it to check Ie11 Are: (test)
(or run)
! (Window.ActiveXObject) & amp; Amp; In the window "ActiveXObject" I have all VMEs in IEEE:
Notice: This does not work for IE12:
As you can see here, this is the correct return:
What can we do:
Obviously, they added machine bit space:
I11:
"Mozilla / 5.0 (Windows NT 6.3; WOW64; Trident .NET4.0E; .NET4.0C; .NET CLR 3.5.30729; .NET CLR 2.0.50727; .NET CLR 3.0.30729; rv : 11.0) such as Gecko " ie12:
" Windows NT 6.3; Win64; X64; Trent / 7.0; .NET4.0E; .NET4.0C; .NET CLR 3.5.307 29; .NET CLR 2.0.50727; .NET CLR 3.0.3072 9; RV .: 11.0) Geoco like " so we can do this:
/x64|x32/ig.test (window.navigator .userAgent) This will only correct for IE 12.
Comments
Post a Comment