Comments (10)
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.
Related to #65.
from ua-parser.
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.
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.
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.
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 tabletisTablet
is just terribly brittle. The really bad example is Windows Tablet which can returntrue
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
forisMobileDevice
andisTablet
andfalse
forisMobile
so doesn't break the classification. - iPad (mini or not since the UA doesn't provide a distinction) is
true
forisMobileDevice
andisTablet
- iPod touch is
true
forisMobileDevice
andisMobile
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.
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.
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.
So what should we do: just have a device
object with a single, family
property?
from ua-parser.
Closing. Decided to remove all boolean props from the JS version.
from ua-parser.
Related Issues (20)
- isMobile alternative HOT 2
- Desktop browsers return as Other. HOT 11
- Wrong detection of Amazon Silk HOT 3
- Publish the Java Maven artifact in the maven central repository HOT 3
- ua_parser:pig
- Outlook UA strings
- Linux Mint 17.2 is reported as linux mint 17 HOT 1
- Edge Browser not detected HOT 4
- Device family is not getting parsed properly HOT 2
- Node js upgradation
- uap-lua HOT 1
- Case sensitive regex match in C# uaparser HOT 1
- used in hive udf gives IOException HOT 1
- unit test error HOT 1
- Convert the .net project to a portable project so i can target more platforms
- Tests fail in Java Directory with the lastest regexes.yaml
- Mobile BingBot detected as iPhone HOT 1
- Regex expressions for web application scanners HOT 1
- ua_dict missing data raises: exceptions.TypeError: parse_device() takes exactly 3 arguments (1 given)
- regex place holder is not working in regex_yaml HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ua-parser.