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:

 Enter image details here

 Enter image details here

Enter image details here

 Enter image details here

Notice: This does not work for IE12:

As you can see here, this is the correct return:

Image Details Here

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

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -