• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to detect browser settings?

 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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();

}
 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
http://webreference.com/tools/browser/javascript.html

Eric
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic