Open GoogleCodeExporter opened 8 years ago
Any idea how to reliably detect when we're on a mobile device?
Original comment by a...@golang.org
on 17 Sep 2012 at 4:56
A quick and simple way as discused here http://stackoverflow.com/a/3540295 is
to check for keywords in the user agent.
if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|Windows
Phone/i.test(navigator.userAgent) == false) {
editor.focus();
}
N.B. I have included Windows Phone in there too, seperate from the SO answer.
Projects like http://detectmobilebrowsers.com/ offer more robust solutions for
multiple platforms, they appear to have jQuery script, so that should fit right
in with the Go Tour already.
Original comment by nadineng...@gmail.com
on 18 Sep 2012 at 11:32
Removing the call to editor.focus() completely (for all platforms) is another
option.
It's simple, keeps the experience consistent across browsers and isn't a huge
loss.
Choosing to edit the code requires enough activity that an extra mouse click
won't be a burden.
Original comment by josephmd...@gmail.com
on 19 Mar 2013 at 6:46
Original issue reported on code.google.com by
nadineng...@gmail.com
on 16 Sep 2012 at 7:57