練功房推薦書單

  • Google!Android 3手機應用程式設計入門(第四版)
  • 賈伯斯傳(軟皮精裝版)
  • 猛虎出閘制霸版:最新OCP Java SE 6 Programmer專業認證(附原始程式碼及範例檔)
  • SCWCD 5 猛虎出閘:Java Web 應用程式專業認證
用戶端環境(瀏覽器軟體版本、安裝Plugin軟體、作業系統等)偵測  XML
Forum Index » 網頁程式設計 Web Development
Author Message
andowson

六段學員
[Avatar]

Joined: 2007-01-02 22:20:40
Messages: 652
Location: 台北
Offline

Using the navigator object to detect client's browser
JavaScript - Browser detect

Java Plugin Detector

jQuery browser plugin detection 1.0.2可以偵測瀏覽器是否支援下列物件
Flash
Silverlight
PDF(checks if pdf mimetype is supported not limited to one PDF application)
Java
Quicktime
Windows Media Player
Shockwave
Real player

OS 版本判別
<script type="text/javascript">
<!--
// source: http://www9.plala.or.jp/oyoyon/html/script/platform.html
function detectOS() {
    var os, ua = navigator.userAgent;
    if (ua.match(/Win(dows )?NT 6\.1/)) {
    	os = "Windows 7";				// Windows 7
    }
    else if (ua.match(/Win(dows )?NT 6\.0/)) {
    	os = "Windows Vista";				// Windows Vista
    }
    else if (ua.match(/Win(dows )?NT 5\.2/)) {
    	os = "Windows Server 2003";			// Windows Server 2003
    }
    else if (ua.match(/Win(dows )?(NT 5\.1|XP)/)) {
    	os = "Windows XP";				// Windows XP
    }
    else if (ua.match(/Win(dows )? (9x 4\.90|ME)/)) {
    	os = "Windows ME";				// Windows ME
    }
    else if (ua.match(/Win(dows )?(NT 5\.0|2000)/)) {
    	os = "Windows 2000";				// Windows 2000
    }
    else if (ua.match(/Win(dows )?98/)) {
    	os = "Windows 98";				// Windows 98
    }
    else if (ua.match(/Win(dows )?NT( 4\.0)?/)) {
    	os = "Windows NT 4.0";				// Windows NT 4.0
    }
    else if (ua.match(/Win(dows )?95/)) {
    	os = "Windows 95";				// Windows 95
    }
    else if (ua.match(/Mac|PPC/)) {
    	os = "Mac OS";					// Macintosh
    }
    else if (ua.match(/Linux/)) {
    	os = "Linux";					// Linux
    }
    else if (ua.match(/(Free|Net|Open)BSD/)) {
    	os = RegExp.$1 + "BSD";				// BSD
    }
    else if (ua.match(/SunOS/)) {
    	os = "Solaris";					// Solaris
    }
    else {
    	os = "Unknown";					// Other OS
    }
    return os;
}
// -->
</script>

http://en.wikipedia.org/wiki/Microsoft_Windows#Timeline_of_releases

彈跳視窗支援/快顯封鎖程式偵測(Google, Yahoo, MSN工具列)
https://stock2.ubot.com.tw/ServiceProvider/WebTest/Default2.aspx

偵測Proxy=>檢查Header的HTTP_X_FORWARDED_FOR是否為空值
http://www.study-area.org/coobila/tutorial_320.html

This message was edited 8 times. Last update was at 2009-12-30 13:38:12


分享經驗 累積智慧
[WWW] [MSN]
 
Forum Index » 網頁程式設計 Web Development
Go to: