I have come to a simple, short and fast method to detect the actual browser being used via javascript, regardless of whether the user-agent is being overridden manually or not, which is even more reliable than the (now deprecated) jQuery.browser sniffing method. This one relies on looking at the window.navigator.productSub property.
In your case, for detecting IE only, this should work in all modern browsers:
if(!window.navigator.productSub && window.navigator.appName !== "Opera")
It works because only IE and Opera have navigator.productSub as "undefined". And the Blink engine has the same as Webkit. Konqueror and all branches of Safari have navigator.productSub = 20030107.
While I have yet to fully determine is this navigator.productSub is reliable for ALL browser, the following information suggest it's a safe one for 99% of cases, even for good old Netscape:
https://developer.mozilla.org/en-US/docs/DOM/window.navigator.productSub
http://www.billpegram.com/JavaScript/navigatorproperties.html
PS: And for some more history on navigator.productSub timestamps:
Why does navigator.productSub always equals '20030107' on Chrome and Safari?