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

Ability to find out the iOS version #30

Open
thehappycoder opened this issue May 30, 2014 · 5 comments
Open

Ability to find out the iOS version #30

thehappycoder opened this issue May 30, 2014 · 5 comments

Comments

@thehappycoder
Copy link

Is it possible with this plugin?

@le717
Copy link
Contributor

le717 commented May 31, 2014

@thehappycoder No, it is not possible. $.browser.version will bring out the browser version, not the platform version. Would it be possible to support? Yes, it would, as the iOS version is listed in the UA. It would require a new $.browser variable, editing of the regex, and changing under scores to dots for consistency, but none of that is too terribly hard. I could probably do it, but I don't know how to regex yet. :(

@le717
Copy link
Contributor

le717 commented Jul 9, 2014

@gabceb Would this featured be considering inside the scope of jquery-brower? I just dug through that link I posted above, and iOS has a fairly consistent UA. The iOS version usually comes after CPU OS, then the version number is stated in the form MAJOR_MINOR, with MAJOR_MINOR_PATCH occurring for patch versions and a very few using only MAJOR, followed by like Mac OS X. There are a few that have everything lowercase, so it needs to be a case-insensitive search. There are also a few that follow the same format but inject iPhone, so the format is CPU iPhone OS MAJOR[_MINOR_PATCH] like Mac OS X. And there are still a small few do not follow the format or do not list the iOS version at all (Mozilla/5.0 (iPod; U; CPU like Mac OS X; en) AppleWebKit/420.1 (KHTML, like Gecko) Version/3.0 Mobile/3A101a Safari/419.3, for example).

So while it would be possible to get the iOS version from the UA in most cases thanks to it being rather consistency, I'm not sure if it is something that should be considered for a plugin that detects browser details.

@le717
Copy link
Contributor

le717 commented Jul 9, 2014

I forgot to add that all other instances of OS occur in the phrase like Mac OS X, so that might make it easier to ensure the iOS version is actually gathered.

@gabceb
Copy link
Owner

gabceb commented Jul 10, 2014

@le717 send me a PR with the OS information code + test and I will test it out and add it if it works for all major OSs

@le717
Copy link
Contributor

le717 commented Jul 10, 2014

@gabceb I'll see what I can do. Regex has been a confusion to me (this would be a good time to learn them), and I'm smack in the middle of a big deal with college work, so I may not get this completed any time soon, but I'll try. :)

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

3 participants