-1

The JS code below can reveal if your browser is an IE.

var isIE = /*@cc_on!@*/!1;

Is there a way to prevent this behavior without disabling javascript?

Milos
  • 2,927
  • 1
  • 15
  • 27
  • 2
    Even if you could disable this behavior in particular, [there are other ways](http://stackoverflow.com/questions/12489546/how-to-get-browsers-name-client-side) to detect this. – GoBusto Mar 19 '15 at 10:02
  • I am doing one step at a time :) – Milos Mar 19 '15 at 10:05
  • 1
    What's your end goal? As a long time web developer I can think of dozens and dozens of ways that a "web view" could reveal to me that it is Internet Explorer... And even more through code. I see this as a pretty hopeless quest. – scunliffe Mar 19 '15 at 10:12
  • @scunliffe End goal is a custom IE with total anonymity. Removing this kind of browser sniffing is important part of it. Apart from using ua string, conditional compilations, documentMode, clientCaps and maybe a couple more methods there is no much more ways to detect it. Why would you call it hopless? – Milos Mar 19 '15 at 10:23
  • 2
    @Milos I consider it hopeless as each browser IE/Firefox/Chrome/Safari/Opera etc gives various hints as to which browser it actually is. I can run JavaScript that will tell me if a browser is IE7, IE8, IE9, IE10, IE11 etc. One can even detect if it is IE11 on windows 8 running on the desktop... Or in tiled "Metro mode". There is literally hundreds of indicators that each browser reveals under the covers. – scunliffe Mar 19 '15 at 10:36
  • @scunliffe Well, if thats the case, then it is indeed hopeless. Thanks Scunliffe – Milos Mar 19 '15 at 11:28

1 Answers1

1

The end goal as determined from comments on the question is to see if there is a way to "hide" a browser's identity from any kind of inspection from JavaScript to aid in creating a custom browser with total anonymity.

I feel that this would be next to impossible based on all of the hints that the browser provides that reveals it's true identity.

In the case of Internet Explorer, here is just a sampling of the (readonly) property values that indicate a browser is Internet Explorer

//This could be any element
var bStyle = document.body.style;
for(var x in bStyle){
  console.log(x + ':' + bStyle[x]);
}

This returns properties like (ms is the prefix for Microsoft properties):

msBlockProgression: 
msInterpolationMode: 
msBackfaceVisibility:
msPerspective: 
msPerspectiveOrigin: 
msTransformStyle:
msTransform: 
msTransformOrigin: 
msAnimation: 
msAnimationDelay: 
msAnimationDirection: 
msAnimationDuration: 
msAnimationFillMode: 
msAnimationIterationCount: 
msAnimationName: 
msAnimationPlayState: 
msAnimationTimingFunction: 
msFlex: 
msFlexAlign: 
msFlexDirection: 
msFlexFlow: 
msFlexItemAlign: 
msFlexLinePack: 
msFlexNegative: 
msFlexOrder: 
msFlexPack: 
msFlexPositive: 
msFlexPreferredSize: 
msFlexWrap: 
and 50+ more...

There's also dozens of IE only APIs that one could check for that would reveal IE.

console.log(typeof(window.createPopup));
//>> function in IE, undefined in other browsers

console.log(typeof(document.body.currentStyle));
//>> object in IE, undefined in other browsers

Then there's all the IE-only technologies... Active-X, VML, XML Data Islands, VBScript, Behaviors, CSS Expressions, etc. All provide indicators as to the browser actually being Internet Explorer.

I don't use it personally, but the idea behind the Tor Browser seems to be the better approach... anonymizing your "tracks" rather that what browser is actually used.

scunliffe
  • 62,582
  • 25
  • 126
  • 161