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

Both tablet() and phone() return positive values for unknown mobile #20

Closed
denich opened this issue Mar 9, 2015 · 0 comments
Closed

Comments

@denich
Copy link
Contributor

denich commented Mar 9, 2015

Precondition:
Have use agent considered as Mobile but not Tablet, for instance Acer nr11:
"Mozilla/5.0 (compatible; MSIE 9.0; Windows Phone OS 7.5; Trident/5.0; IEMobile/9.0; Acer; Allegro)"

Actual:
Both tablet() and phone() methods return positive value ("UnknownMobile").

Expected:
I suppose that calling tablet() or phone() in this case should return falsy value (null). Because generally table/phone checking are implemented like so:

if (md.tablet()) {}
//or
if (md.phone()) {}

but not like

if (md.tablet() && md.tablet() !== "UnknownMobile") {}
@hgoebl hgoebl closed this as completed in 60f0598 Mar 22, 2015
hgoebl added a commit that referenced this issue Mar 22, 2015
clear tablet and phone statuses for unknown mobile. Fixes #20
hgoebl added a commit that referenced this issue Mar 22, 2015
    - use Mobile-Detect@2.8.12
    - breaking change: phone() and tablet() won't return 'UnknownMobile' -> have to check mobile() as well (issue #20)
    - breaking change: fallback detection phone/tablet is now based on smaller screen side (issue #23)
    - expose internal implementation in case somebody wants to quick fix or monkey-patch the behaviour
    - add demo page for gh-pages
    - tweak jshint
hgoebl added a commit that referenced this issue Mar 22, 2015
    - use Mobile-Detect@2.8.12
    - breaking change: phone() and tablet() won't return 'UnknownMobile' -> have to check mobile() as well (issue #20)
    - breaking change: fallback detection phone/tablet is now based on smaller screen side (issue #23)
    - expose internal implementation in case somebody wants to quick fix or monkey-patch the behaviour
    - add demo page for gh-pages
    - tweak jshint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant