Closed bobsilverberg closed 2 years ago
@bobsilverberg Thank you for opening the topic for discussion. As a single-page-app builder I always need to adjust my user interface design for three things:
Fine tuning a web app for these 3 main environments is a must. So far I have been using PoeHaH/devicedetector to do that. It works great. It has an isMobile
feature that returns true for either tablet or phone which is useful as well in terms of being able to write self-explanatory code.
If ua-parser-js had the same functionality I wouldn't have to include yet another separate library and I could simplify my code.
Was discussed here: https://github.com/faisalman/ua-parser-js/issues/182#issuecomment-263115448
I notice that
device.type
can be one ofconsole, mobile, tablet, smarttv, wearable, embedded
, but for a desktop browser it just returnsundefined
. Is there a reason that decision was made? Coulddevice.type
returndesktop
in cases where it is known to be a desktop browser?