Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not detect Microsoft Surface as a tablet #32

Closed
bjankord opened this issue Dec 20, 2012 · 13 comments
Closed

Does not detect Microsoft Surface as a tablet #32

bjankord opened this issue Dec 20, 2012 · 13 comments

Comments

@bjankord
Copy link

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

User Agent when in desktop mode:
Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; ARM; Trident/6.0; Touch)

Notice, they are both the same. If you do detect the Microsoft Surface as a tablet, when the user switches their tablet to desktop mode, it will still be recognized as a tablet, when it probably should respect the users decision and recognize it as a desktop.

@ghost ghost assigned serbanghita Jan 2, 2013
@sebastien-mignot
Copy link

This would be really good to fix, more and more of those tablets are bought (already some clients of us complained).
You can resolve the 2 problems in this issue separatly thought :
First this needs to be recognized as a tablet (isTable() true).
Then the desktop mode can be fixed whenever the device will not send exactly the same UA in desktop mode as in default mode.

@StevenMapes
Copy link

You can add the UA to the tablet list if you want it to come up as a tablet. I've done that with some Android devices which were not matching.

The problem bjankord has reported though is that the UA does not change. bjankord, do you have a copy of all of the headers sent by the device in different modes? Is there any difference between them? If there is not then this would require a client-side solution, assuming the viewport or some other client detectable setting is changed.

@httpete
Copy link

httpete commented Mar 1, 2013

I am not a regex god, but I got this by adding this to the $tabletDevices.

    'SurfaceTablet'     => 'Mozilla.*MSIE.*; Touch',

@httpete
Copy link

httpete commented Mar 6, 2013

improvement here, discerns a tablet from windows 8 phone , which works ok. Phone comes up with Windows 8 Phone, Tablet does Windows NT

    'SurfaceTablet'     => 'Mozilla.*MSIE.*; Windows NT.*; Touch',

@serbanghita
Copy link
Owner

@httpete I have to test this against https://github.com/serbanghita/Mobile-Detect/blob/master/manual_tests/mobilePerVendor_useragents.inc.php

Do you have any tablet with Windows Mobile? Thanks a lot!

@httpete
Copy link

httpete commented Mar 7, 2013

Hi Serban,

Yes I have an windows Surfact RT tablet, I posted to the wiki the regex I am using that I patch in and it does work, distinguishing between windows mobile phone and rt tablet correctly.

I am also working with our management team to get you the pledgie funds you need for your V3.0 project. I want to thank you personally for your efforts on this project. TimeTrade relies on your code for our responsive web apps, and we eliminated the need for bigger more cumbersome systems.

Pete Smith

On Mar 7, 2013, at 8:41 AM, Serban Ghita <[email protected]mailto:[email protected]> wrote:

@httpetehttps://github.com/httpete I have to test this against https://github.com/serbanghita/Mobile-Detect/blob/master/manual_tests/mobilePerVendor_useragents.inc.php

Do you have any tablet with Windows Mobile? Thanks a lot!


Reply to this email directly or view it on GitHubhttps://github.com//issues/32#issuecomment-14560883.

@serbanghita
Copy link
Owner

@httpete Great, if this is critical for you I'll test the regex a.s.a.p. To be sure I need to research the differences between HTTP headers of phones running http://en.wikipedia.org/wiki/Windows_Phone_8 and tablets running http://en.wikipedia.org/wiki/Windows_RT

@lespinosa
Copy link

Hi Serbanghita!

We have some update for this issue?

Thanks!

@cripsta187
Copy link

I would also appreciate an update because more and more users have a surface tablet.
Any hot fix solution to this problem?

Regards, Crip

@httpete
Copy link

httpete commented Mar 21, 2013

To me, we need to break up the devices by screen res. Mobile and tablet are really arbitrary groupings. I think most break it up by screen size. I would love this API to say screenSize Less than 768 wide

-- Sent from my HP TouchPad


On Mar 20, 2013 4:46 PM, cripsta187 [email protected] wrote:

I would also appreciate an update because more and more users have a surface tablet.
Any hot fix solution to this problem?

Regards, Crip


Reply to this email directly or view it on GitHubhttps://github.com//issues/32#issuecomment-15202314.

serbanghita added a commit that referenced this issue Mar 21, 2013
Some new tablets.
@serbanghita
Copy link
Owner

@httpete working on that API.

Everybody check isSurfaceTablet(). Please also test: isWindowsMobileOS and isWindowsPhoneOS - I need confirmations for these until I finish the automated tests.

@lespinosa
Copy link

Thanks! Serban

@seancodev
Copy link

Hi all,

Change Windows Phone OS to:
'WindowsPhoneOS' => 'Windows Phone 8.0|Windows Phone OS|XBLWP7|ZuneWP7|Windows Phone 8.0; Trident/.; IEMobile/.; ARM;', (note /.* after IEMobile and Trident)

Surface Tablet to:
'SurfaceTablet' => 'Windows NT 6.[23]; ARM;.(Tablet|ARMBJS)|Mozilla.MSIE.; Windows NT.; Touch|Windows NT 6.[23]; ARM; Trident/.*; Touch;',

Good to go.

Cheers,
Sean

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants