1

Possible Duplicate:
Detect 64-bit or 32-bit Windows from User Agent or Javascript?

I just downloaded itunes from the Apple website and when I clicked download it automatically downloaded the x64 version as I am on a 64 bit machine. Does anyone know how the website is able to detect what architecture I am using? Is it and can it be done with javascript? If so how?

Community
  • 1
  • 1
geoffs3310
  • 5,599
  • 11
  • 51
  • 104
  • In a browser, if you run `window.navigator.userAgent` in a console like Chrome's, you'll see your browser is tattling on you. Many browsers also send this to the server in a header. – Jared Farrish Sep 29 '12 at 10:14
  • Some hints must be available from `navigator.userAgent` string. – techfoobar Sep 29 '12 at 10:14
  • For instance: `User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.79 Safari/537.4` – Jared Farrish Sep 29 '12 at 10:15

2 Answers2

0

The browser sends a user agent string to the server in every request. It contains some information about the browser and the operating system.

Guffa
  • 687,336
  • 108
  • 737
  • 1,005
0

When you want to check what user-agent string your browser sent the website you are visiting right now, enter this into your browsers navigation bar:

javascript:alert(window.navigator.userAgent);
Philipp
  • 67,764
  • 9
  • 118
  • 153