GithubHelp home page GithubHelp logo

Comments (10)

tobie avatar tobie commented on May 29, 2024

Not sure how to best solve this without introducing the idea of a model / version number for devices, eg:

{'is_spider': False, 'is_mobile': True, 'family': 'BlackBerry', model: '9320' }

@elsigh ideas welcomed.

from ua-parser.

tobie avatar tobie commented on May 29, 2024

Related to #65.

from ua-parser.

dmolsen avatar dmolsen commented on May 29, 2024

FWIW, the PHP lib classifies this UA as mobile because $ua->family matches a string in my mobile browser array. This info is already available in regexes.yaml as mobile_user_agent_families.

from ua-parser.

tobie avatar tobie commented on May 29, 2024

Right, so I was looking for string to be equal, not using stristr.

Doesn't that make the Playbook a mobile device too and break the current test suite?

from ua-parser.

tobie avatar tobie commented on May 29, 2024

The distinctions we're making between isMobile and isMobileDevice worries me, actually. It's awfully confusing.

For example, how do you categorize and iPod touch? is it a tablet or a mobile device?

What about an iPad mini with 3G and Skype? is it a mobile device or a tablet?

What's next? Whether the device is touch enabled or not?

Screen size?

Has a camera?

Etc.

When do we cross the line and fall into territory that belongs in a project like WURFL or the like? (Note that I think a good, open-source version of such a project would be awesome, it feels like its out of scope).

/cc @elsigh

from ua-parser.

dmolsen avatar dmolsen commented on May 29, 2024

I think it's sort of confusing as well. There's a reason I haven't pushed the isMobile etc. back upstream myself. They seemed to be a departure from the original intent of ua-parser which is why I called my lib a pseudo-port (and it still is).

  • isMobile should be thought of as a mobile browser not on a tablet.
  • isMobileDevice can be either a phone or tablet
  • isTablet is just terribly brittle. The really bad example is Windows Tablet which can return true for devices that, if we were just looking at them, we'd classify as netbooks. They just happen to have the right OS/under-the-hood-hardware combo to affect the UA. That and the screen dimensions open a whole other can of worms.

As for the examples cited:

  • Playbook is true for isMobileDevice and isTablet and false for isMobile so doesn't break the classification.
  • iPad (mini or not since the UA doesn't provide a distinction) is true for isMobileDevice and isTablet
  • iPod touch is true for isMobileDevice and isMobile

Frankly, I was thinking of dropping isTablet. I think it gives false hope. isMobileDevice could then also be dropped and isMobile then simply refers to what I classify as mobile browsers. It can be expanded to be set to true for devices we know are mobile but can't assign a browser family too. The problem there though is that, in my set-up, isMobile would be true for the Playbook because I list BlackBerry WebKit as a mobile browser which the Playbook is obviously using. To me that would be an appropriate classification. You may disagree :)

FWIW, I haven't properly integrated the test suite. Doing that during the holiday weekend.

// just because i can include it... 🎱

from ua-parser.

tobie avatar tobie commented on May 29, 2024

This is a massive can of worms. Think we should just stay out of it.

On inspection of the python code source I notice @elsigh is also doing strict equality comparisons with the mobile browser array.

from ua-parser.

elsigh avatar elsigh commented on May 29, 2024

Oops, I shouldn't have pulled that ;0
Trigger happy holidays.

Yeah, ultimately, I agree that these distinctions are troublesome.
What does "mobile" even mean anymore?

I'd be ok with just reverting this concept from ua-parser.

from ua-parser.

tobie avatar tobie commented on May 29, 2024

So what should we do: just have a device object with a single, family property?

from ua-parser.

tobie avatar tobie commented on May 29, 2024

Closing. Decided to remove all boolean props from the JS version.

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.