Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

window.ActiveXObject difference in IE11

Tags:

While looking over our site in IE11 to find out what's broken now, we noticed that the below code doesn't evaluate to "true" correctly:

this.isIEBrowser = false; if (window.ActiveXObject){     this.isIEBrowser = true; } 

Upon further investigation, it appears that typeof(window.ActiveXObject) results in "undefined", whereas in IE10 mode, it results in "function". When I add window.ActiveXObject to the watch list, it shows as being a function type. Similarly, if I do typeof(window.ActiveXObject.prototype), I get "object" for both IE11 and IE10.

Does anybody know why this changed, or where I can find a list of these types of differences between IE10 and IE11 so that I can figure out what other breaking changes there are?


UPDATE 10/30/13:

When I put this in, I had originally thought this was a difference with Type evaluation in the IE11 javascript engine. I've since come to realize that this issue is specific to the window.ActiveXObject object. So I've changed the name of this question from "Typeof difference in IE11" to "window.ActiveXObject difference in IE11"

like image 989
Kevin Heidt Avatar asked Oct 28 '13 15:10

Kevin Heidt


Video Answer


1 Answers

You can't use that check for IE11:

http://msdn.microsoft.com/en-us/library/ie/dn423948%28v=vs.85%29.aspx

Starting with IE11, the navigator object supports plugins and mimeTypes properties. In addition, the window.ActiveXObject property is hidden from the DOM. (This means you can no longer use the property to detect IE11.)

like image 68
Joe Avatar answered Oct 06 '22 00:10

Joe