各式瀏覽器於各式平台上的使用者代理字串(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 NameVersionSystem.Web.HttpContext.CurrentWindows XPWindows 7Windows 8Windows 8.1Windows 10
Internet Explorer6Request.Browser.BrowserIE
Internet Explorer6Request.UserAgentMozilla/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 Explorer7Request.Browser.BrowserIE
Internet Explorer7Request.UserAgentMozilla/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 Explorer8Request.Browser.BrowserIE
Internet Explorer8Request.UserAgentMozilla/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 Explorer9Request.Browser.BrowserIE
Internet Explorer9Request.UserAgentMozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.0; Trident/5.0)
Internet Explorer10Request.Browser.BrowserIEIE
Internet Explorer10Request.UserAgentMozilla/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 Explorer11Request.Browser.BrowserMozillaMozillaInternetExplorer
Internet Explorer11Request.UserAgentMozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rev:11.0) like GeckoMozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rev:11.0) like GeckoMozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko
Microsoft Edge20Request.Browser.BrowserChrome
Microsoft Edge20Request.UserAgentMozilla/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 FireFox37Request.Browser.BrowserFirefoxFirefoxFirefoxFirefoxFirefox
Mozilla FireFox37Request.UserAgentMozilla/5.0 (Windows NT 5.2; rv:37.0) Gecko/20100101 FireFox/37.0Mozilla/5.0 (Windows NT 6.0; rv:37.0) Gecko/20100101 FireFox/37.0Mozilla/5.0 (Windows NT 6.2; WOW64; rv:37.0) Gecko/20100101 FireFox/37.0Mozilla/5.0 (Windows NT 6.3; WOW64; rv:37.0) Gecko/20100101 FireFox/37.0Mozilla/5.0 (Windows NT 10.0; WOW64; rv:37.0) Gecko/20100101 Firefox/37.0
Google Chrome42Request.Browser.BrowserAppleMAC-SafariAppleMAC-SafariAppleMAC-SafariAppleMAC-Safari未測試
Google Chrome42Request.UserAgentMozilla/5.0 (Windows NT 5.2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36Mozilla/5.0 (Windows NT 6.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36未測試
Opera12.16Request.Browser.BrowserOperaOperaOperaOpera未測試
Opera12.16Request.UserAgentOpera/9.80 (Windows NT 5.2) Presto/2.12.388 Version/12.16Opera/9.80 (Windows NT 6.0) Presto/2.12.388 Version/12.16Opera/9.80 (Windows NT 6.2; WOW64) Presto/2.12.388 Version/12.16Opera/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