Skip to content
This repository has been archived by the owner on Jun 9, 2023. It is now read-only.

Browser is mobile #10

Open
ChoiZ opened this issue Aug 7, 2015 · 1 comment
Open

Browser is mobile #10

ChoiZ opened this issue Aug 7, 2015 · 1 comment

Comments

@ChoiZ
Copy link

ChoiZ commented Aug 7, 2015

Hi Jonathan,

I think in the futur, it will be nice to add an attribute "desktop" or "mobile" in "os" node.

If "os" group is "Windows Phone" or "Android" or "iOS":

desktop:false;
// or mobile:true;

In the other cases:

desktop:true;
// or mobile:false;

Regards,

@dmhendricks
Copy link

I just added an experimental device.mobile property to the master branch of dmhendricks/PgwBrowser. Rather than adding the deivce type to the existing browser/os definitions, I opted to use detectmobilebrowsers.com's method.

Example:

var pgwBrowser = $.pgwBrowser();
console.log(pgwBrowser.device.mobile); // returns true or false

There is also an experimental device.type string property which currently only returns "mobile" or "desktop." My plan is to add more device types and other information eventually, as time permits.

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

No branches or pull requests

2 participants