-
Notifications
You must be signed in to change notification settings - Fork 892
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
Not working with Samsung Galaxy Tab 4 #5
Comments
This is a general problem not only for this special device. There are some regexps which are way too general and then many devices fall into the wrong category even if stronger regexps exist. I have to discuss this with @serbanghita and find a special treatment if necessary. Just reversing the order of checks wouldn't really help - we only moved the problem to phones detected as tablet then. |
@toshsharma thanks for reporting this! @hgoebl I will research and update the Samsung tablet regex with the new tablet releases and get back asap. Yes the |
Thanks. Although, even when I updated the tablet regex to include the model number for the Tab 4, it doesn't work because the UA for the Tab 4 contains the word "Samsung" (which is not present in earlier tablet models, I think), thereby causing it to be recognized as a phone (since |
@toshsharma sounds like the solution is obvious:
The problem is that I don't have very reliable tests - many of them failed from the beginning. But maybe with such a change the number of failing tests decreases. I hope I manage to release a new version before my holiday (on Saturday)... |
@serbanghita thanks for the instant and constructive input! |
Thanks @hgoebl - I believe that'll work well. I'll test with some devices and let you know if something breaks with this change - as you said, I expect things should be better with it. There seem to be multiple variants of the Tab 4 - SM-T530, SM-T531, SM-T535 - I'm hoping you'll update the regex with all of them. Thanks again for a quick response! :) |
@toshsharma I've released Mobile_Detect |
Thanks @serbanghita! |
@toshsharma no need to fork - I'm currently fixing the bug! |
Awesome - thanks for the quick resolution! |
Could you please update the regex to include "SM-T331" (Samsung Galaxy Tab 4 8" variant)? |
@toshsharma absolutely. I'm adding it tonight with some other newly released tablets. Will get back to you! |
Updated Mobile_Detect to |
Thanks @serbanghita. I'll pick the ne wlib once your changes are integrated into mobile-detect.js. Do you think it'd be a good idea to report mobile() === true if the OS is Android or iOS, even if it can't be figured out whether the device is a phone or a tablet? This could be useful in the case of new mobile devices, where it'd still be meaningful to know that the device is a mobile (regardless of phone or tablet). |
The UA is:
Mozilla/5.0 (Linux; Android 4.4.2; en-us; SAMSUNG SM-T530NU Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Version/1.5 Chrome/28.0.1500.94 Safari/537.36
Since the check for a phone is before that for a tablet, its being identified as a phone - mobielDetectRules for a phone contain the regex /Samsung/i. This causes the regex for a Samsung tablet /SAMSUNG.*Tablet/ to never be matched since the check for a phone is made before that for a tablet. Should the checking order be reversed (tablet, then phone)?
The text was updated successfully, but these errors were encountered: