各式瀏覽器於各式平台上的使用者代理字串(User Agent)

因為Microsoft的Internet Explorer瀏覽器的HTTP標頭,萬年不支援Unicode編碼格式的爛設計下,以至於到了Windows 10時代的Microsoft Edge,後端程式設計師依然要為這個爛設計去進行例外的處理,真的有必要向下相容成這樣嗎?個人覺得都已經拋棄了IE這個名字,就應該沒有什麼好顧忌了才是,唉...

總而言之,這一篇文章名為討論User Agent,因此我把我實驗出來各平台之各瀏覽器的User Agent數據寫在這裡,有需要的人自行取用。要辨識是否為微軟品牌,大家應該不難挑出規則才是。

值得注意的是,Microsoft Edge的Request.Browser.Browser回傳值竟然是「Chrome」,我的下巴差一點掉下來。

Lists of User agent of Browsers on Operation Systems

Browser Name Version System.Web.HttpContext.Current Windows XP Windows 7 Windows 8 Windows 8.1 Windows 10
Internet Explorer 6 Request.Browser.Browser IE
Internet Explorer 6 Request.UserAgent Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022)
Internet Explorer 7 Request.Browser.Browser IE
Internet Explorer 7 Request.UserAgent Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.2; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022)
Internet Explorer 8 Request.Browser.Browser IE
Internet Explorer 8 Request.UserAgent Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729)
Internet Explorer 9 Request.Browser.Browser IE
Internet Explorer 9 Request.UserAgent Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.0; Trident/5.0)
Internet Explorer 10 Request.Browser.Browser IE IE
Internet Explorer 10 Request.UserAgent Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0) Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; WOW64; Trident/6.0)
Internet Explorer 11 Request.Browser.Browser Mozilla Mozilla InternetExplorer
Internet Explorer 11 Request.UserAgent Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rev:11.0) like Gecko Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rev:11.0) like Gecko Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko
Microsoft Edge 20 Request.Browser.Browser Chrome
Microsoft Edge 20 Request.UserAgent Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240
Mozilla FireFox 37 Request.Browser.Browser Firefox Firefox Firefox Firefox Firefox
Mozilla FireFox 37 Request.UserAgent Mozilla/5.0 (Windows NT 5.2; rv:37.0) Gecko/20100101 FireFox/37.0 Mozilla/5.0 (Windows NT 6.0; rv:37.0) Gecko/20100101 FireFox/37.0 Mozilla/5.0 (Windows NT 6.2; WOW64; rv:37.0) Gecko/20100101 FireFox/37.0 Mozilla/5.0 (Windows NT 6.3; WOW64; rv:37.0) Gecko/20100101 FireFox/37.0 Mozilla/5.0 (Windows NT 10.0; WOW64; rv:37.0) Gecko/20100101 Firefox/37.0
Google Chrome 42 Request.Browser.Browser AppleMAC-Safari AppleMAC-Safari AppleMAC-Safari AppleMAC-Safari 未測試
Google Chrome 42 Request.UserAgent Mozilla/5.0 (Windows NT 5.2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Mozilla/5.0 (Windows NT 6.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 未測試
Opera 12.16 Request.Browser.Browser Opera Opera Opera Opera 未測試
Opera 12.16 Request.UserAgent Opera/9.80 (Windows NT 5.2) Presto/2.12.388 Version/12.16 Opera/9.80 (Windows NT 6.0) Presto/2.12.388 Version/12.16 Opera/9.80 (Windows NT 6.2; WOW64) Presto/2.12.388 Version/12.16 Opera/9.80 (Windows NT 6.2; WOW64) Presto/2.12.388 Version/12.16 未測試
.NetFramewrok System.Web.HttpContext.Current.Request.Browser.Browser System.Web.HttpContext.Current.Request.UserAgent