none
User Agent for Microsoft Tablets RRS feed

  • Question

  • I can't find a CLEAR documentation about the user agent used for the Microsoft tablet devices (like Microsoft Surface)

    I could find that the user agent for a surface tablet can be:

    Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Win64; x64; Trident/6.0; Touch)

    Or if the device contains an ARM processor, the user agent can be:

    Not a touch screen device (so, not a tablet???): 

    Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; ARM; Trident/6.0)

    A touch screen device (because of Touch):

    Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; ARM; Trident/6.0; Touch)

    I have to set up some rules to detect a tablet device, and so, my question is, what are the rules to detect a Microsoft tablet device based on the user agent. When I'm talking about rules, I mean: if the user agent contains ARM and Touch it's a Microsoft tablet device.





    Wednesday, April 9, 2014 11:34 AM

All replies

  • This question doesn't have anything to do with the Ink or Touch API. You'll probably get better answers if you ask in an appropriate forum.

    That said, detecting a tablet by user agent is probably not feasible and is almost certainly the wrong approach. The Surface Pro probably will have the same user agents as my touch-screen laptop and my touch-screen desktop (assuming I run the same browsers).

    Check out http://blogs.msdn.com/b/ieinternals/archive/2013/09/21/internet-explorer-11-user-agent-string-ua-string-sniffing-compatibility-with-gecko-webkit.aspx for more comments on IE11 User Agents.

    --Rob

    Thursday, April 10, 2014 4:26 AM
  • 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; 
      }
    }


    Thursday, October 4, 2018 12:29 PM