[racket-dev] Downloading DrRacket for Mac is hard?
On Thu, Aug 11, 2011 at 3:25 AM, Eli Barzilay <eli at barzilay.org> wrote:
> On Aug 10, 2011, at 11:33 PM, Guillaume Marceau <gmarceau at gmail.com>
wrote:
>> Does the combo box auto detect the
>> downloader's platform for the User-Agent header.
>
> Yes, in some cases when it's possible to make a guess.
>
I found this Stackoverflow article:
http://stackoverflow.com/questions/1741933/detect-64-bit-or-32-bit-windows-from-user-agent-or-javascript
which says that the following code
deployJava.isWin64OS = function() {
return navigator.userAgent.indexOf('WOW64')>-1 ||
window.navigator.platform=='Win64';
};
will return one of these:
64 bit MacOS + 64 bit Safari or 32 bit Chrome:
window.navigator.platform=MacIntel
32 bit windows + safari:
window.navigator.platform=Win32
64 bit Windows + 64 bit IE:
window.navigator.platform=Win64
window.navigator.cpuClass=x64
64 bit Windows + 32 bit IE:
window.navigator.platform=Win32
window.navigator.cpuClass=x86
64 bit Windows + 32 Firefox (or Chrome):
window.navigator.platform=Win32
32 bit linux mint (i686) + firefox:
window.navigator.platform=Linux i686
64 bit Ubuntu (x86_64) + 32 bit Chrome:
window.navigator.platform=Linux i686
64 bit Ubuntu + 64 bit Epiphany:
window.navigator.platform=Linux x86_64
In the ambiguous cases, you can get additional information by checking for
flash. Because Adobe doesn't support flash player on x64 browsers, if
detection is successful then it is definitely a 32 bit browser, if not, then
the request came from either a 32 bit browser without flash plugin or from a
64 bit browser.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/dev/archive/attachments/20110811/bd48e965/attachment.html>