window.ActiveXObject difference in IE11

Kevin Heidt picture Kevin Heidt · Oct 28, 2013 · Viewed 55.2k times · Source

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"

Answer

Joe picture Joe · Oct 28, 2013

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.)