问题
I'm trying to determine the user agent string for surface RT for testing purposes.
回答1:
Just do some Google'ing and you will find your answer.
Internet Explorer 10 User-agent string
Internet Explorer 10 on Windows RT:
Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; ARM; Trident/6.0)
Update after comment below
The link above also states:
Identifying touch-enabled systems
Internet Explorer 10 introduces the "Touch" UA string token. If this token is present at the end of the UA string, the computer has touch capability, and is running Windows 8 (or later). This UA string will be transmitted on a touch-enabled system running Windows 8.
Note Internet Explorer 10 on Windows 7 will never report a UA string with the "Touch" token.Internet Explorer 10 on Windows RT with Touch enabled:
Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; ARM; Trident/6.0; Touch)
Update for Internet Explorer 11
User-agent string changes
Here is what's reported for Internet Explorer 11 on Windows 8.1:
Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko
Here is the string for Internet Explorer 11 on Windows 7:
Mozilla/5.0 (Windows NT 6.1; Trident/7.0; rv:11.0) like Gecko
If you compare these values to those reported by earlier versions of Internet Explorer, you'll find the following changes:
- The compatible ("compatible") and browser ("MSIE") tokens have been removed.
- The "like Gecko" token has been added (for consistency with other browsers).
- The version of the browser is now reported by a new revision ("rv") token.
回答2:
I went to a Microsoft retail location yesterday (November 13, 2012) and used IE to browse to http://whatsmyuseragent.com/ in both Metro and Desktop modes.
Here is the user agent given in both cases:
Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; ARM; Trident/6.0; Touch)
回答3:
For those interested. Here is the User Agent string for a Surface Pro (128Gb):
Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Win64; x64; Trident/6.0; Touch)
回答4:
Actually, everyone is wrong. The actual user agent that comes up in metro mode is
Mozilla/4.0 (Compatible; msie 7.0; windows nt 6.2; arm; trident/6.0; touch; .net4.0e; .net4.0c; tablet PC 2.0; Version).
回答5:
This is what I get when I visit the whatsmyuseragent site:
Mozilla/5.0 (Windows NT 6.3; Win64; x64; Trident/7.0; Touch; rv:11.0) like Gecko
Hope this helps.
回答6:
surface RT will run only IE 10.
The User Agent string isMozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; ARM; Trident/6.0)
(source: this MSDN blog entry)
This type of information is typically published well in advance of the delivery of the underlying browsers / machines, because of the interest Web Browser manufacturers have in seeing the new browsers well supported by most Web Sites.
回答7:
UserAgent for devices -
IE desktop - "Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; .NET4.0C; .NET4.0E; .NET CLR 2.0.50727; .NET CLR 3.0.30729; .NET CLR 3.5.30729; InfoPath.3; rv:11.0) like Gecko"
IE Surface Pro - "Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; Touch; .NET4.0C; .NET4.0E; Tablet PC 2.0; rv 11.0) like Gecko"
Edge desktop - "Mozilla/5.0 (Windows NT 10.0; Win64; x64; ServiceUI 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36 Edge/15.15063"
Edge surface - "Mozilla/5.0 (Windows NT 10.0; Win64; x64; ServiceUI 13) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36 Edge/17.17134"
By looking at the above user agents we don't have any clear distinguish between desktop and surface pro for Edge(IE is having Tablet PC check available ). So here to detect the window device first(surface pro is window tablet) and then verify if the device is touch device.
window + touch: true - surface pro
window + touch: false - desktop
isSurface: function () {
// Window device Check
if(!!navigator.userAgent.match(/Win/)) {
// Check if the device is touch
return !!navigator.userAgent.match(/Tablet PC/i) || "ontouchstart" in document.documentElement;
}
}
来源:https://stackoverflow.com/questions/13076839/what-is-the-user-agent-string-for-surface-rt