인터넷정보

웹브라우저, 언어, 운영체제 보여주기

알 수 없는 사용자 2007. 10. 12. 13:38
<SCRIPT LANGUAGE="javascript">
<!-- Hide from old browsers
latest = "6.2.2";

languagesq = new Object;
languagesq["un"] = "알려지지 않은 언어, ";
languagesq["cn"] = "중국 (simp.) 어, ";
languagesq["cs"] = "Czech language, ";
languagesq["da"] = "Danish language, ";
languagesq["de"] = "German language, ";
languagesq["el"] = "Greek language, ";
languagesq["en"] = "English language, ";
languagesq["es"] = "Spanish language, ";
languagesq["fc"] = "French (Canada) language, ";
languagesq["fi"] = "Finnish language, ";
languagesq["fr"] = "French language, ";
languagesq["hu"] = "Hungarian language, ";
languagesq["it"] = "Italian language, ";
languagesq["ja"] = "일본어, ";
languagesq["ko"] = "한국어, ";
languagesq["nl"] = "Dutch language, ";
languagesq["no"] = "Norwegian language, ";
languagesq["pl"] = "Polish language, ";
languagesq["pt"] = "Brazilian Portuguese language, ";
languagesq["ru"] = "Russian language, ";
languagesq["sv"] = "Swedish language, ";
languagesq["tr"] = "Turkish language, ";
languagesq["tw"] = "Chinese (trad.) language, ";
languagesq["uk"] = "영어 (UK), ";
languagesq["de-de"] = "German language, ;"
languagesq["en-gb"] = "영어 (UK), ";
languagesq["en-us"] = "영어, ";
languagesq["es-es"] = "Spanish language, ";
languagesq["fr-fr"] = "French language, ";
languagesq["ja-jp"] = "일본어, ";

lang = "un";
Component = "Unknown browser";
platform = "Unknown platform";
OS = "";
version = parseFloat(navigator.appVersion);
UA = navigator.userAgent;
ua = navigator.userAgent.toLowerCase();

// Language
if (((start = ua.indexOf("[")) > 0) &&
    ((end = ua.indexOf("]")) == (ua.indexOf("[") + 3))){
  language = ua.substring(start+1, end);
} else if (navigator.language) {
  language = navigator.language.toLowerCase();
} else if (navigator.userLanguage) {
  language = navigator.userLanguage.toLowerCase();
}
if (languagesq[language]) {
  lang = language;
}

// OS
if (((ua.indexOf("ppc") > 0) && (ua.indexOf("mac") > 0))
    || (ua.indexOf("mac_power") > 0)) {
//  if (ua.indexOf("os x")) {
//    OS = "macosx";
//  } else {
    OS = "macppc";
//  }
} else if ((ua.indexOf("linux 2.2") > 0)
           || (ua.indexOf("netscape6") && ua.indexOf("linux") > 0)) {
  OS = "linux2.2";
} else if (ua.indexOf("win") > 0) {
  OS = "win32";
}

// Other info
start = UA.indexOf('(') + 1;
end = UA.indexOf(')');
str = UA.substring(start, end);
info = str.split('; ');

if (ua.indexOf('msie') != -1) {
  platform = info[2];
  Component = navigator.appName;
  str = info[1].substring(5, info[1].length);
  version = parseFloat(str);
} else if ((start = ua.indexOf("netscape6")) > 0) {
  if (info[0].toLowerCase() == "windows") {
    platform = info[2];
  } else {
    platform = info[0] + " " + info[2];
  }
  Component = "Netscape";
  version = ua.substring(start+10, ua.length);
  if ((start = version.indexOf("b")) > 0 ) {
    pr = version.substring(start+1,version.length);
    str = version.substring(0,version.indexOf("b"));
    version = str + " Preview Release " + pr;
  }
} else {
  if(info[2]) {
    if (info[0].toLowerCase() == "windows") {
      platform = info[2];
    } else {
      platform = info[0] + " " + info[2];
    }
  } else {
    platform = info[0];
  }
  if (ua.indexOf("gecko") > 0) {
    Component = "Mozilla";
  } else if (ua.indexOf("nav") > 0) {
    Component = "Netscape Navigator";
  } else {
    Component = "Netscape Communicator";
  }
}
// Some formatting
if ((platform.indexOf("NT") != -1) && (platform.indexOf("5.1") != -1)) {
  platform = "Windows XP";
}
if ((platform.indexOf("NT") != -1) && (platform.indexOf("5.0") != -1)) {
  platform = "Windows 2000";
}
if (parseInt(version) == parseFloat(version)) {
  version = version + ".0";
}

// Message according to the sniff result


You_R_running = "<font face=\"Arial,Helvetica\" color=\"#000000\" size=\"1\">당신이 현재 사용하고 있는것은..:</font><BR>\n";
You_R_running += "<font face=\"Arial,Helvetica\" color=\"#003366\" size=\"1\"><B>" + Component + " " + version + "</B></font><BR> ";
You_R_running += "<FONT face=\"Arial,Helvetica\" SIZE=1>" + languagesq[lang] + " 운영체제 : " + platform + "</font>";

document.writeln("<TABLE CELLPADDING=8 CELLSPACING=0 BORDER=0 WIDTH=100%><TR><TD>");
document.writeln(You_R_running);

// Stop hiding from old browsers -->
</SCRIPT>
반응형