add os_flavor detection for firefox

git-svn-id: file:///home/svn/framework3/trunk@8185 4d416f70-5f16-0410-b530-b9f4589650da
This commit is contained in:
James Lee 2010-01-21 11:26:16 +00:00
parent 2b8a2d56a1
commit 4d644ab895
1 changed files with 13 additions and 1 deletions

View File

@ -122,10 +122,22 @@ function getVersion(){
// "Windows NT 6.0"
// haven't tested on 64-bit Windows
version = navigator.oscpu;
os_name = version.split(' ')[0];
if (version.match(/i.86/)) {
arch = "#{ARCH_X86}";
}
if (version.match(/Windows/)) {
os_name = "#{oses::WINDOWS}";
switch(version) {
case "Windows NT 5.0": os_flavor = "2000"; break;
case "Windows NT 5.1": os_flavor = "XP"; break;
case "Windows NT 6.0": os_flavor = "Vista"; break;
case "Windows NT 6.1": os_flavor = "7"; break;
}
}
if (version.match(/Linux/)) {
os_name = "#{oses::LINUX}";
}
// end navigator.oscpu checks
// Verify whether the ua string is lying by checking the major version
// number against what we detected using known objects above. If it