

No user agent detection for the iPad Mini - dirkdk
http://www.mobilexweb.com/blog/ipad-mini-detection-for-html5-user-agent

======
stephen_g
Often I feel like it would be better if sites couldn't even tell the
difference at all between my phone and tablet and a normal browser... Some
mobile sites are great, but only a very small minority. Most times I get
redirected to a mobile site, I switch to the desktop version and find it's a
far better browsing experience and they shouldn't have bothered in the first
place...

An example of this is almost any blog with the WPTouch plugin... Most regular
Wordpress theme gives you a better reading experience going to the desktop
site and double tapping the main column to make it fill the screen!

~~~
dmethvin
Although the title talks about detecting the iPad Mini, the article makes it
clear that the real dilemma is that there is no way to know the physical size
of pixels as presented on the screen and size things accordingly. That's
especially important on touch devices where you want to size controls to make
them finger friendly.

~~~
eridius
I think that's a red herring. Sure, the iPad mini has a higher DPI than an
iPad 2. iPad 2 is 132ppi and iPad mini is 163ppi. But guess what else is
163ppi? That's right, every non-retina iPhone. So if your touch areas are
large enough for an iPhone user to use, then it's large enough for an iPad
mini user to use as well.

~~~
natrius
It sounds like you're arguing for designing iPad mini apps as iPhone apps,
which is contrary to one of Apple's major arguments for the device over
existing 7" tablets. Apple wants iPad minis to run iPad apps. Their customers
probably do as well.

~~~
eridius
No, I'm advocating for not drawing a distinction between iPhone and iPad when
figuring out the size of touch areas on touch-enabled apps, whether the app is
optimized for an iPhone-sized display or whether it's a touch-enabled "normal"
page.

~~~
chris_wot
I don't think you quite understand. As the devices have different physical
characteristics, they require designers to know the screen sizes and pixel
density.

The iPad 2 has a screen resolution of 1024x768 with a density of 132 pixels
per inch. The iPad mini has a resolution of 1024x768 with a density of 163
pixels per inch.

This means that if you design for an iPad2 you are _guaranteed_ to have
smaller fonts and elements than on an iPad mini. If you design for an iPad
mini, then you are guaranteed to have fonts and elements that are too large.
If you design for the middle ground then your design stinks when viewed on
both devices.

As for the iPhone argument: people use media queries for a reason - they
design differently for the smaller screen sizes of the iPhone than they do for
an iPad.

It's essential that on a touch based device that you can work out how big
things will be. Perhaps I can put this in a more concrete way: if you have
ever tried to upvote a comment on HN via an iPad and accidentally downvoted
the person, you will immediately see the issue of tiny fonts/UI elements.

Now make those down and up arrows 20% smaller.

As you can see from one of the links in the submitted article, even Apple's
own website is hard to read on a mini. Not exactly inspiring. I'm quite
surprised that such a design focused company didn't realise this was going to
be an issue!

~~~
eridius
Two counterpoints:

1) Why are you designing a site specifically for the iPad mini? That seems
pointless. Media queries are great and all, but if you want to design
specifically for touch then you should just assume a 163ppi, and that will be
usable by everyone.

2) iPads typically see "full" or "desktop" websites. And they can scale. If
something is too small at the default scale, then zoom in.

------
kylec
The solution to this is to design for the iPad mini. If you make the user
interface elements large enough to tap on a mini, they will also be large
enough to tap on a full sized iPad. This also has the benefit of presenting a
single user experience no matter what size iPad the user has, which I think is
a plus.

~~~
Firehed
This.

Follow Apple's human interface guidelines and you'll get this for free. Don't
treat them as sacred tomes, but it's no accident that the DPI on the iPad Mini
is the same as that of the non-retina iPhone/iPod Touch, and they suggest the
same minimum tap target size on both platforms.

The only exception to this is if you're making a ruler, and you're not.

------
stcredzero
_> Don’t disable zoom ability in the viewport metatag, such as in user-
scalable=no._

Please don't ever do this. It really sucks for reading your site on a touch
tablet.

~~~
notatoad
but please please please, if you're making a site that is even the least bit
elastic, do put in a "<meta name="viewport" content="width=device-
width,initial-scale=1.0,minimum-scale=1.0">. if you don't put in a min-
scale=1, the iPad renders pages at 1024px wide and then scales them down to
768px, making everything unnecessarily small.

~~~
jarek
That sounds like a bug in the iPad browser?

~~~
eli
It's not really a bug; that's how it's designed. If you don't tell it that
you've though about how to zoom for mobile devices, it guesses for you.

~~~
dthunt
Making sure there's at least some legible text in the page if it's not on the
last couple lines sounds like a start...

------
danielsju6
There is no user-agent detection between any models on iOS in Safari; it's not
an oversight. You've never been able to detect a difference between iPad 1. 2,
3, 4 or 2(mini) or iPhone 3, 3GS, 4 and 5, nor should you. User agent
detection is horrible and this isn't news.

Downloads over iTunesD show difference though; since you may want to serve
them different payloads. "iTunes-iPad/5.1.1 (4; 16GB; dt:77)" vs. "iTunes-
iPad-M/6.0.1 (2; 64GB; dt:75)"

~~~
chris_wot
You are missing the point. It's not about UA detection, it's about feature
detection.

------
ricardobeat
Please, let's not get started all over again. UA detection is _dead_. Don't do
it. Mobile Safari has a zoom-in feature (double-tap) that works perfectly
without any "fixes" by the website developer.

~~~
ronancremin
Rumours of it's death are premature. It's used by over 80% of the Alexa top
100 sites. [http://mobiforge.com/designing/blog/server-side-device-
detec...](http://mobiforge.com/designing/blog/server-side-device-detection-
used-82-alexa-top-100-sites) Why? Because it can help tailor the user
experience, reduce page payload etc.

You can test whether a site is using UA detection here:
<http://hydra.mobiforge.com>

~~~
quarterto
And billions of people smoke. Doesn't mean it's good practice.

------
nerd_in_rage
Good. User-Agent detection has always been a hack.

~~~
fwr
How is this good? How is this considered to be a hack? You make this sound
like something that can be achieved in a more sophisticated way. How?

~~~
nerd_in_rage
It's good because it's not something that should be done.

Ask yourself why you _need_ to detect the user agent.

~~~
ronancremin
Why? Because it can help improve the user experience (page payload, image
sizes etc). There's a good reason why Google, Facebook, Netflix, eBay, Yahoo,
BBC, Amazon etc. do it. It's also part of RFC 1945 (HTTP 1.0) and RFC 2616
(RFC 1.1). Not exactly a hack -- it's designed into the HTTP protocol since
1996.

------
mattk4k
All the comments so far have been with regards to modifying a site's
appearance based on the device.

A totally separate use case is for business intelligence reporting. It's not
_so_ bad with the iPad 2 vs iPad Mini because they have virtually identical
hardware other than the physical screen size (same CPU, memory, CPU, etc).
However it's more important with, say, the iPad 3 vs iPad 4. Although both are
fairly similar (both are branded as the "new iPad"), they do have different
CPUs.

For our business, it is valuable to know which physical devices people are
using, not just which OS or browser version they are on. Our product is one
which heavily relies on the CPU performance - knowing which devices our
customers are on tells us which devices we should prioritise the testing on.
Yes, we may be able to optimise the product to work on an iPhone 3G (picked as
an example of a lower end iPhone), but if the number of customers who use that
device is low enough, then the business case won't stack up. When it comes to
device testing, it seems only prudent to try and mimic the device profile of
our customer base.

Also there are other, perhaps less tangible, use cases for understanding the
device profile for our customer base. For instance, if iPad Minis are more
popular for a particular demographic (perhaps rush-hour commuters), this may
inform business decisions about development priorities, feature roll-out, or
marketing campaigns.

In summary - please don't assume that the only reason for device detection is
to change the appearance of a site; the data can be valuable in other ways
too.

~~~
Tyrannosaurs
I don't think anyone is assuming that that's the only reason but just because
something is valuable to corporates doesn't mean you have the right to have
that information.

After all I'm sure that it would be useful to you if my browser told you my
age, sex, salary, where I live and how many kids I have but that doesn't mean
it should happen.

Besides in this instance the hardware is remarkably similar to the iPad 2
(which is the thing you can't tell it apart from). It's unlikely there's
anything the mini can do that the iPad 2 can't from a performance perspective
so you really don't need to distinguish them.

------
tomrod
I think this is a case for continuing the current course. By that, I mean that
these obvious missing issues of Apple would be fixed in the next revision if a
large plurality of websites did not display well. I doubt the websites
themselves would be affected in the long term, however. Of course, I base this
behavior analysis on a sample of one (my apologies to the staticians out
there).

------
JuDue
Hmm

I'd argue detecting iPad 2 in landscape mode would be an opportunity for an
extra RHS column

While on Mini, you'd just drop that

Shame we can not have that possibility, as the extra 19% of screen makes an
extra column readable.

~~~
Devilboy
I'd be pretty unhappy if my favourite website was missing a column just
because I was on my mini.

~~~
JuDue
You already have that on phone vs desktop.

It's the nature of things, and should not be an issue if the responsive design
is done properly

~~~
Devilboy
But the iPad and the iPad mini has the same number of pixels. If I browse a
site on my mini I expect the same UI as when I use my iPad.

~~~
JuDue
This is true. But there is a strong case for increasing font size on a mini,
and letting the content breath more. So dropping a RHS column would help that.

This is if you believe in non-zoomable design. If you allow the user to zoom,
one option would be to deliver full desktop design and content, as you prefer.

------
malandrew
Give it a math problem to solve and find our how long it takes to solve it.
It's a hack, but that is probably the best way to determine what iOS device it
is.

~~~
wmf
It also has the same processor as the iPad 2. And probably the same RAM, so
don't go there either.

------
philo23
This really only matters for pages designed to look "native", in which case as
long as you don't have a tap area smaller than about 44x44 pixels (like Apple
has always recommended) then you shouldn't really have a problem at all.

If it's a normal site then this shouldn't matter one bit because most people
will be zooming into your pages anyway, unless you've disabled that (which you
really shouldn't.)

------
dasil003
After the ipad mini introduction video with Ive waxing on about how they
redesigned it from scratch for the smaller form factor, it's irritatingly
condescending that they report false results back to media queries to prevent
designers from doing the same.

------
mikemoka
would it be possible to do it by using one of these two approaches after the
first general iPad user agent check?

-using a full screen image and getting an useful parameter from that via javascript

-uploading a screenshot of a graphics element via javascript/canvas for a server to evaluate

------
benguild
They'll probably be able to patch this. Most likely it's a simple oversight

~~~
danielsju6
No oversight, you've never been able to differentiate between device models in
the iOS User-Agent. Nothing to see here.

~~~
chris_wot
The article isn't talking about UA detection, but rather feature detection. In
particular, working out the devices ppi.

------
lwat
Thank you Apple! Good decision there. If your site needs special tweaks just
because the screen is a mere 19% smaller then your design sucks. Just my
opinion.

