Meaningless Drivel is fun!
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

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "How to detect browser settings?" Watch "How to detect browser settings?" New topic

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

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)
} = (agt.indexOf("msie") != -1);

if (

if (agt.indexOf("netscape6")!=-1)


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

Joined: Nov 08, 2001
Posts: 15385

I agree. Here's the link:
subject: How to detect browser settings?
It's not a secret anymore!