Answers
Dec 02, 2009 - 11:42 PM
I don't really know the answer, but I think that in principle reliable browser detection based on the UserAgent string is impossible since the browsers can decide (and have decided) to put anything they like in the UserAgent string if they think it will have any benefit to them while surfing.
I reality, of course, it's more or less possible to keep up to date with what different browsers report, hence your request for an updated detection routine.
At the same time I was thinking that the object you refer to is called BrowserCapabilities which implies that you might not always be as interested in make and model of a specific browser, but of the capabilities of that browser, which is an entirely different thing.
In your case I'm sure you have a reason to want to know the exact browser and OS, and I would like to hear what that reason might be.
Thanks, and I hope you find your answer!
Jakob
I reality, of course, it's more or less possible to keep up to date with what different browsers report, hence your request for an updated detection routine.
At the same time I was thinking that the object you refer to is called BrowserCapabilities which implies that you might not always be as interested in make and model of a specific browser, but of the capabilities of that browser, which is an entirely different thing.
In your case I'm sure you have a reason to want to know the exact browser and OS, and I would like to hear what that reason might be.
Thanks, and I hope you find your answer!
Jakob
Jan 18, 2010 - 02:47 AM
The question looks to be abandoned by the user who asked it. If no action is taken within 2 days, a Quomon Moderator will consider closing the question and distributing the points.
The Quomon Team
The Quomon Team
Jun 02, 2012 - 12:44 PM
When you're trying to determine the user operating system. If you knows the user operating system (You can request it in ASP.NET by "Request.Browser.Platform", and wants to know know the specific version like 2000, XP and Vista,MacOS), or you can judge the version by using the user-Agent.
var OSName="Unknown OS";
var OS = navigator.appVersion;
if (!ie)
{
//document.write("THIS IS NOT IE");
OS = navigator.userAgent;
}
if (OS.indexOf("Win")!=-1) {
if ((OS.indexOf("Windows NT 5.1")!=-1) || (OS.indexOf("Windows XP")!=-1))
OSName="Win XP";
else if ((OS.indexOf("Windows NT 7.0")!=-1))
OSName="Win 7";
else if ((OS.indexOf("Windows NT 6.0")!=-1))
OSName="Win Vista/Server 08";
else if (OS.indexOf("Windows ME")!=-1)
OSName="Win ME";
else if ((OS.indexOf("Windows NT 4.0")!=-1) || (OS.indexOf("WinNT4.0")!=-1) || (OS.indexOf("WinNT")!=-1))
OSName="Win NT";
else if ((OS.indexOf("Windows NT 5.2")!=-1))
OSName="Win Server 03";
else if ((OS.indexOf("Windows NT 5.0")!=-1) || (OS.indexOf("Windows 2000")!=-1))
OSName="Win 2000";
else if ((OS.indexOf("Windows 98")!=-1) || (OS.indexOf("Win98")!=-1))
OSName="Win 98";
else if ((OS.indexOf("Windows 95")!=-1) || (OS.indexOf("Win95")!=-1) || (OS.indexOf("Windows_95")!=-1))
OSName="Win 95";
else if ((OS.indexOf("Win16")!=-1))
OSName="Win 3.1";
else
OSName="Win Ver. Unknown";
if (OS.indexOf("WOW64")!=-1) OSName=OSName+"(x64)"
else OSName=OSName+"(x32)"
}
else if (OS.indexOf("Mac")!=-1) OSName="MacOS";
else if (OS.indexOf("X11")!=-1) OSName="UNIX";
else if (OS.indexOf("Linux")!=-1) OSName="Linux";
var OSName="Unknown OS";
var OS = navigator.appVersion;
if (!ie)
{
//document.write("THIS IS NOT IE");
OS = navigator.userAgent;
}
if (OS.indexOf("Win")!=-1) {
if ((OS.indexOf("Windows NT 5.1")!=-1) || (OS.indexOf("Windows XP")!=-1))
OSName="Win XP";
else if ((OS.indexOf("Windows NT 7.0")!=-1))
OSName="Win 7";
else if ((OS.indexOf("Windows NT 6.0")!=-1))
OSName="Win Vista/Server 08";
else if (OS.indexOf("Windows ME")!=-1)
OSName="Win ME";
else if ((OS.indexOf("Windows NT 4.0")!=-1) || (OS.indexOf("WinNT4.0")!=-1) || (OS.indexOf("WinNT")!=-1))
OSName="Win NT";
else if ((OS.indexOf("Windows NT 5.2")!=-1))
OSName="Win Server 03";
else if ((OS.indexOf("Windows NT 5.0")!=-1) || (OS.indexOf("Windows 2000")!=-1))
OSName="Win 2000";
else if ((OS.indexOf("Windows 98")!=-1) || (OS.indexOf("Win98")!=-1))
OSName="Win 98";
else if ((OS.indexOf("Windows 95")!=-1) || (OS.indexOf("Win95")!=-1) || (OS.indexOf("Windows_95")!=-1))
OSName="Win 95";
else if ((OS.indexOf("Win16")!=-1))
OSName="Win 3.1";
else
OSName="Win Ver. Unknown";
if (OS.indexOf("WOW64")!=-1) OSName=OSName+"(x64)"
else OSName=OSName+"(x32)"
}
else if (OS.indexOf("Mac")!=-1) OSName="MacOS";
else if (OS.indexOf("X11")!=-1) OSName="UNIX";
else if (OS.indexOf("Linux")!=-1) OSName="Linux";
Add New Comment