GithubHelp home page GithubHelp logo

Comments (11)

Ironholds avatar Ironholds commented on June 21, 2024

...yes. What do you think it should be doing?

from ua-parser.

mamoorkhan avatar mamoorkhan commented on June 21, 2024

It should be saying as desktop or pc or mac, something like that, which give a more clearer image, as in other could be some older era phones also

from ua-parser.

Ironholds avatar Ironholds commented on June 21, 2024

And it knows that it's a desktop how? And, PC is a specific model, how?

The entire point of "other" is "the user agent does not include an explicit string identifying the device model, so we can't provide that device model". Desktop browsers don't do that; there's no way to determine if it's a PC, or a Mac, or a netbook, or, as you note, an older phone. The parser can only work from the information that's actually in the user agent.

from ua-parser.

mamoorkhan avatar mamoorkhan commented on June 21, 2024

it can just simply point out that its a PC, simple

from ua-parser.

Ironholds avatar Ironholds commented on June 21, 2024

Except the goal is to identify specific device models, not device classes, and you haven't explained how it would "simply" do this (or provided example user agents which would allow this information to be extracted, and have a problem).

from ua-parser.

mamoorkhan avatar mamoorkhan commented on June 21, 2024

with the OS classified into device classes

from ua-parser.

Ironholds avatar Ironholds commented on June 21, 2024

Except, again, the goal is to identify devices, not device classes, and OS is not uniformly a mapper to the actual hardware. Nor is it uniformly a mapper to a single class of hardware.

from ua-parser.

mamoorkhan avatar mamoorkhan commented on June 21, 2024

can you point me in a direction if I want to know the device class too?

from ua-parser.

Ironholds avatar Ironholds commented on June 21, 2024

No; there isn't a project for that that I'm aware of. It has been discussed as a future feature but we haven't started work on it yet.

from ua-parser.

mamoorkhan avatar mamoorkhan commented on June 21, 2024

best of luck with that

from ua-parser.

mrjgreen avatar mrjgreen commented on June 21, 2024

Just to add to this, if your application really needs to log some sort of device type for desktops and "Other" isn't acceptable to your users, you could make a reasonable effort by adding some simple custom logic after the UA Parser stage. Something like this may give you an acceptable output:

if($device === 'Other')
{
    $device = contains($osFamily, 'mac os') ? 'Mac' : 'PC'; // Or whatever identifiers you want
}

We have a similar issue to contend with - essentially our users don't understand the difficulties of user agent parsing, they just want to know how many Mac users VS PC users they have, so we have no choice but to try and provide that information, even if the results are spurious. Our logic is slightly more complex than this and also uses this extended set of regexes which include brand/model, which commenthol has been trying to get merged into the core for some time now.

It all depends on what you need and how much work you are willing to do but as @Ironholds has said, it is impossible to tell what the desktop model is from the user agent string because the information is not supplied.

from ua-parser.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.