[Zope-CMF] Browser Detection

Josef Albert Meile jmeile@hotmail.com
Fri, 14 Sep 2001 18:11:40 -0000


I have the following script which detects the browser:


<SCRIPT LANGUAGE="JavaScript">
<!-- Original:  Gregor (legreg@legreg.de) -->

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
var useragent = navigator.userAgent;
var bName = (useragent.indexOf('Opera') > -1) ? 'Opera' : 
navigator.appName;
var pos = useragent.indexOf('MSIE');
if (pos > -1) {
bVer = useragent.substring(pos + 5);
var pos = bVer.indexOf(';');
var bVer = bVer.substring(0,pos);
}
var pos = useragent.indexOf('Opera');
if (pos > -1)	{
bVer = useragent.substring(pos + 6);
var pos = bVer.indexOf(' ');
var bVer = bVer.substring(0, pos);
}
if (bName == "Netscape") {
var bVer = useragent.substring(8);
var pos = bVer.indexOf(' ');
var bVer = bVer.substring(0, pos);
}
if (bName == "Netscape" && parseInt(navigator.appVersion) >= 5) {
var pos = useragent.lastIndexOf('/');
var bVer = useragent.substring(pos + 1);
}
document.writeln('<b>Browser Name: </b>' + bName + '<br>');
document.writeln('<b>Browser Version: </b>' + bVer + '<br>');
}
//  End -->
</script>


My question is:
How can I store the bName and bVer variables into the REQUEST object?