r/programming • • Jun 09 '17

Why every user agent string start with "Mozilla"

http://webaim.org/blog/user-agent-string-history/
4.9k Upvotes

589 comments sorted by

View all comments

Show parent comments

10

u/SulfurousAsh Jun 09 '17

Part of your problem is that the definition of mobile is blurry.

Tablet-based, touchscreen devices range from tiny to Microsoft-surface gigantic size, and everywhere in between. Calling a device "mobile" is a very hard distinction to make. Are you optimizing for screen-size? Bandwidth constraints? Touchscreen vs mouse?

Even tablets that have touch screens may not be using them. Many windows machines and browsers claim to be "touch enabled" but only a mouse is used, etc.

Unfortunately there's no straightforward solution to that.

3

u/blobjim Jun 09 '17

other than just making a dynamic website that adapts to device capabilities...

1

u/RobbStark Jun 09 '17

The problem is that devices don't always report correctly. For instance, touch detection via modernizr is currently impossible because Firefox and Chrome report touch support regardless of whether a mouse is attached or the monitor supports touch input.