12

Hey there, I just wondered if there is a method to detect if the 64bit or 32bit Version of IE8 is running?

Because there are some major Bugs in the Facebook Javascript SDK which only occure in IE8x64...

Christian Engel
  • 3,738
  • 5
  • 28
  • 44

4 Answers4

12

According to this IEBlog post you should be able to read it from the browsers User-Agent string via navigator.userAgent:

Detecting 64-bit Internet Explorer

As machines with more than 4 gigabytes of RAM become more common, more and more users are running 64-bit versions of Windows. For compatibility with 3rd party add-ons, the 32-bit edition of Internet Explorer remains the default on 64-bit systems. However, in some cases it can be useful for websites to recognize when users are visiting using 64-bit systems—for instance, a site may want to know whether to offer a 64-bit executable download.

Tokens in the User-Agent string will enable you to determine whether or not the user is running a 64-bit version of Windows, and whether they are running the 64-bit edition of Internet Explorer.

64-bit IE on 64-bit Windows:

Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Win64; x64; Trident/4.0)

32-bit IE on 64-bit Windows:

Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; WOW64; Trident/4.0)

Incidentally, WOW64 stands for “Windows on Windows 64-bit.”

Community
  • 1
  • 1
Martin Buberl
  • 45,844
  • 25
  • 100
  • 144
  • Cool, thats helpful, altough it's not accessible with JS. Thank you very much! – Christian Engel Feb 17 '11 at 16:13
  • 2
    @Christian Engel: You're welcome! What do you mean with "not accessible with JS"? Something like `javascript:alert(navigator.userAgent.indexOf("MSIE 8.0") !=-1 && navigator.userAgent.indexOf("x64") !=-1);` works just fine. – Martin Buberl Feb 18 '11 at 18:45
3

The User Agent string for a 64-bit IE browser will indicate that it's 'x64' or 'Win64' if it's a 64-bit browser.

http://blogs.msdn.com/b/ie/archive/2009/01/09/the-internet-explorer-8-user-agent-string-updated-edition.aspx

A 64-bit IE8 user agent string:

Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Win64; x64; Trident/4.0)

vs. a 32-bit

Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; WOW64; Trident/4.0)

wkl
  • 77,184
  • 16
  • 165
  • 176
2

For 64-bit IE on 64-bit Windows window.navigator.platform will be "Win64" and window.navigator.cpuClass will be "x64".

For 32-bit IE on 64-bit Windows window.navigator.platform will be "Win32" and window.navigator.cpuClass will be "x86".

For 32-bit Windows (which therefore must be running 32-bit IE), window.navigator.platform will be "Win32" and window.navigator.cpuClass will be undefined (I think).

-

Source: I made an app that uses JavaScript to determine if someone is using a 32 bit or 64 bit processor. You can see the code here on GitHub.

peterhurford
  • 1,074
  • 1
  • 13
  • 21
0

I'm not sure if you'll be able to detect 32bit/64bit, but this jquery plugin looks promising.

See http://davecardwell.co.uk/javascript/jquery/plugins/jquery-browserdetect/

John Cartwright
  • 5,109
  • 22
  • 25