permaculture playing cards*
The moose likes HTML, CSS and JavaScript and the fly likes How to detect browser settings? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "How to detect browser settings?" Watch "How to detect browser settings?" New topic
Author

How to detect browser settings?

Chinh Tran Nam
Ranch Hand

Joined: Nov 08, 2004
Posts: 35
I got a strange requirement from my client to write a script (in Java, JSP, Javascript or whatever applicable for their JSP application) to check browser settings (IE) to see if it's configured as they need. Here are some settings it has to check:
- Browser version
- JVM version
- Cache Settings
- Font settings
- Security Settings: ActiveX control and plug-in?
- ...

and other system settings like Regional settings, Folder Options,...

Please let me know how to deal with this?
Thanks in advance.
Pradeep LV
Greenhorn

Joined: Nov 05, 2004
Posts: 8
To check the browser version, here is the function written is Javascript

function CheckBrowser()
{
// convert all characters to lowercase to simplify testing
var agt=navigator.userAgent.toLowerCase();
this.major = parseInt(navigator.appVersion);
this.minor = parseFloat(navigator.appVersion);
this.nav = ((agt.indexOf('mozilla')!=-1) && ((agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible') == -1)));

if (this.nav)
{
BrowserType='NS';
}
this.ie = (agt.indexOf("msie") != -1);

if (this.ie)
{
BrowserType='IE';
}

if (agt.indexOf("netscape6")!=-1)
{
BrowserType='NS6';
}

get_os();

}
Tina Long
Ranch Hand

Joined: Mar 04, 2005
Posts: 36
You can look at the request header information. You can read about that in the online book found at: Core Servlets and Java Server Pages

The other thing you can look at is system properties. There is alot of information stored in all those properties.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
http://webreference.com/tools/browser/javascript.html

Eric
 
 
subject: How to detect browser settings?
 
Similar Threads
Servlet response header
Image will not change on the Browser...Saving on the Tomcat Problem.....HELP...Please
Checking browser version & JavaScript enabled
how to remove history from jsp pages
How to detect browser settings?