Reputation: 67
I have a script which contains javascript and I have to check if the CPU architecture is 32bit or 64bit. I can't use IE to check the this because on all machines is the 32bit version installed. When the architecture is detected it should say you have an 64 Bit processor or 32 bit processor. Which options do I have?
Upvotes: 2
Views: 3829
Reputation: 796
If you were developing a Chrome extension (or packaged app), then you could use chrome.runtime.getPlatformInfo
to obtain an object containing a boatload of system information and, from that object, get the architecture as a member of it, but seeing as though you aren't building a Chrome extension or packaged app but a website, I doubt this would help here.
Upvotes: 1
Reputation: 678
It doesn't matter. The hardware is running or is emulating 32-bit mode. So functionally there is no difference to the browser.
So, two things can lead you astray:
-Your 64-bit architecture machine has been crippled from the get-go with a 32-bit OS
-Your 64-bit architecture with a 64-bit OS is running a 32-bit browser
It would be an interesting metric to be able to see the data about how many of your viewers got shafted by their computer manufacturer.
I think with the JavaScript path you are screwed.
However, if you are not opposed to getting a SSL certificate, you may be able to use a Java applet.
http://docs.oracle.com/javase/tutorial/deployment/applet/security.html
Upvotes: 0
Reputation: 4224
navigator.userAgent will mostly contain the architecture. I am not on IE so can't help you there
Upvotes: 1