Click to See Complete Forum and Search --> : various stuff about the user pc
blaster
07-10-2003, 10:27 AM
whats the code to return the operating system????
whats the code to return the browser name and version???
whats the code to return the page viewer screen resolution????
whats the code to return the desktop of the page viewer???
HELP!!!
Most of what you are looking for can be gotten out of navigator.userAgent; To get the screen resolution, use screen.width and screen.height
blaster
07-10-2003, 06:55 PM
explain please... or do the code if u dont mind
<script type="text/javascript">
details = navigator.userAgent;
width = screen.width;
height = screen.height;
alert ("Details: "+details+"\nScreen Width: "+width+"\nScreen Height: "+height);
Charles
07-11-2003, 04:59 AM
For the operating system:
navigator.platform
For the browser name:
navigator.appName
For the browser version:
navigator.appVersion
See http://devedge.netscape.com/library/manuals/2000/javascript/1.3/reference/nav.html for details.
blaster
07-13-2003, 05:22 AM
tks
but.. when i said that i want de operating system i was meaning of if it is windows 98,2000,ME and XP
please help
Charles
07-13-2003, 06:18 AM
I'm afraid that you cannot know that.
blufive
07-13-2003, 09:10 AM
Some browsers include the Operating System in the User-Agent string, but you'll have to dig it out of all the other information. For example, this:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
Is Internet Explorer 6 running on Windows "NT 5.1" (Windows XP)
Hope its enough ...
<script language=JavaScript>
<!--
//-----------------Initazing variables-------------------//
var jscript,vscript,language,resolution,colors,avalW,avalH,real,flash,browname,cookie;
var seq1="",seq2="";
var a=0,b=0,num=0;precent=0;
var realState=false;
var flashState=false;
var G2=false;
var FI=false;
var last=document.lastModified;
var historyP=history.length;
var dateP=new Date();
var ie=document.all?1:0;
var ns=document.layers?1:0;
var dom=document.getElementById?1:0;
var l=(ie||dom)?navigator.browserLanguage:navigator.language;
//-------------------End of variables-------------------//
//----------Cookie and JavaScript check module----------//
if (navigator.javaEnabled()>-1) jscript = "JavaScript present.";
else jscript = "JavaScript not present.";
if (navigator.cookieEnabled) cookie = "Cookies enabled.";
else cookie = "Cookies disabled.";
//--------------------End of module--------------------//
//----------Flash & Real Players check module----------//
numPlugins = navigator.plugins.length;
for(i=0;i<numPlugins;i++)
{
plugin = navigator.plugins[i];
if ((plugin.name.substring(0,10)=="RealPlayer")&&(plugin.name.indexOf("G2")>0)) realState=true;
if ((plugin.name.indexOf("Shockwave Flash")>-1)&&(plugin.description.indexOf("5")>-1)) flashState=true;
}
document.write('<script language=VBScript\> \n');
document.write('on error resume next \n');
document.write('G2 = (NOT IsNull(CreateObject("rmocx.RealPlayer G2 Control")))\n');
document.write('</script\> \n');
document.write('<script language=VBScript\> \n');
document.write('on error resume next \n');
document.write('FI = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4"))) \n');
document.write('</script\> \n');
document.write('<script language=VBScript\>\non error resume next \nG2=(NOT IsNull(CreateObject("rmocx.RealPlayer G2 Control")))\n</script\>\n');
document.write('<script language=VBScript\>\non error resume next\nFI=(IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4")))\n</script\>\n');
if (flashState||FI) flash = "Flash Player precent."
else flash = "Flash Player missing."
if (realState||G2) real = "Real Player installed."
else real = "Real Player missing."
//--------------------End of module--------------------//
//------------------General info module----------------//
if (ie)
{
browname = "Microsoft Internet Explorer";
vscript = "VBScript present.";
avalW = screen.availWidth;
avalH = screen.availHeight;
langInfo();
}
else if (ns)
{
browname = "Netscape Navigator";
avalW = window.innerWidth;
avalH = window.innerHeight;
vscript = "VBScript missing.";
langInfo();
}
else if (dom)
{
browname = "Netscape 6 Gecko";
vscript = "VBScript missing.";
avalW = window.innerWidth;
avalH = window.innerHeight;
}
colors = screen.colorDepth;
resolution = ''+screen.width+' X '+screen.height+'';
//--------------------End of module--------------------//
function langInfo()
{
if (l.indexOf('en')>-1)language='English';
else if (l.indexOf('nl')>-1) language='Dutch';
else if (l.indexOf('fr')>-1) language='French';
else if (l.indexOf('de')>-1) language='German';
else if (l.indexOf('ja')>-1) language='Japanese';
else if (l.indexOf('it')>-1) language='Italian';
else if (l.indexOf('pt')>-1) language='Portuguese';
else if (l.indexOf('es')>-1) language='Spanish';
else if (l.indexOf('sv')>-1) language='Swedish';
else if (l.indexOf('zh')>-1) language='Chinese';
else language='English';
}
boot = 'Downloading..~~..~~..~..~.OK,~~ now booting the CheckSys.~~~<br>'
+'CheckSys version 1.04.21-01~~ (...) ~~# '+last+'<br>'
+'Connecting to client\'s computer...~~...~....~~~....~...~..Done.<br>'
+'Operation system found.<br>'
+'Client\'s browser platform: '+navigator.platform+'<br>'
+'Detected client browser.~~~<br>'
+'Getting browser name.......Browser name:~~ '+navigator.appCodeName+'<br>'
+'Decoding and ajusting browser name........Successful.<br>'
+'Common browser name: '+browname+'<br>'
+'Getting browser version..~...~..~~~..Done.<br>'
+'Browser version: '+navigator.appVersion+'<br>'
+'Checking browser history...........OK<br>'
+''+historyP+' PAGES found in browser history.~~<br>'
+'Autodetecting JavaScript..~.~.~.~.~..~.~.~.~.~.Done.<br>'
+''+jscript+'<br>'
+'Looking for VBScript.~.~.~..~~..~.~..~.Done<br>'
+''+vscript+'<br>'
+'Examining cookies.~.~.~..~~..~.~..~.<br>'
+''+cookie+'<br>'
+'Logging in for additional information.~.~..~.~..~...~.Successfull.<br>'
+'Extracting client\'s date information...~.<br>'
+'Date: '+dateP+'~~~~<br>'
+'Language present in browser....~~...~..~.'+language+'<br>'
+'Screen resolution set to '+resolution+'<br>'
+'Getting color depth....~....~...~...'+colors+' bit<br>'
+'Estimating available browser space....~..~.~..Done. <br>'
+'Browser available width: '+avalW+' pixels<br>'
+'Browser available height: '+avalH+' pixels<br>'
+'Entering inside for plugins information.<br>'
+'Looking for Real Player.~~.~.~.~.~.~.~.~.~.~.~.Done.<br>'
+''+real+'<br>'
+'Checking for Macromedia FLASH player.~.~.~.~.~.~.~.~.~.~.Done.<br>'
+''+flash+'<br>'
+'CheckSys operation complete.~~~<br>'
+'Scan Status.~.~...~.~..~...~OK.~~~<br>';
seq = boot.split("~");
function initCheck()
{
seq1='<tt>'+seq2+'<b style="color:red">'+seq[num]+'</b></tt>';
seq2+=seq[num];
if(ns)
{
with(document.out.document.indoor)
{
document.write(seq1);
document.close();
}
}
if(ie) booty.innerHTML = seq1;
if(dom) document.getElementById("booty").innerHTML = seq1;
if (!(num>=seq.length-1))
{
num++;
down();
window.status=precent+"% complete.";
if (precent<100)precent++;
else window.status="Checking completed."
setTimeout('initCheck()',1);
}
else window.status=("Okay");
}
function down()
{
b+=100;
window.scroll(1,a);
a=setTimeout("down()",1000);
}
onload=initCheck;
//-->
</script>
bleep
07-14-2003, 05:38 PM
Put this between the body tags:
<script language="JavaScript" type="text/javascript">
<!--
document.write(navigator.userAgent)
// -->
</script>
<br>
<br>
<script language="JavaScript" type="text/javascript">
<!--
document.write(navigator.appName," ", navigator.appVersion)
// -->
</script>
That'll give you everything you need to know about the system and the browser.