On Mon, Jul 11, 2011 at 1:36 PM, Brion Vibber <br...@pobox.com> wrote: > On Mon, Jul 11, 2011 at 12:36 PM, Tomasz Finc <tf...@wikimedia.org> wrote: > >> Firefox is tough as the current version has the exact same UA on >> mobile phones AND tablets. And since we don't redirect tablets we >> haven't switched it over yet. >> >> Anyone know why they did that? >> > > Mozilla generally recommends using CSS media queries and other client-side > techs for adapting your pages to small or large screened-devices; while this > is generally a good idea, it doesn't help directly with an issue like this > where we'd really prefer to know a binary "device claiming to have a tiny > freaky screen" or "anything else" so we can divide people down the > mobile-optimized or regular web site paths. (We need to support older/more > primitive phones that don't handle any of this stuff.) > > There are a couple closed-with-extreme-prejudice bugzilla entries like this: > > https://bugzilla.mozilla.org/show_bug.cgi?id=625238 > https://groups.google.com/group/mozilla.dev.platform/browse_thread/thread/43d566ca1333234e?pli=1 > > which mostly look like they're about wanting / not wanting whole gobs of > device data in the user-agent string. > > All *we* really want is "are you a small screen -> include 'Mobile' in the > UA" or "otherwise -> don't include 'Mobile' in the UA"... it may or may not > be worth seeing if that can get added in as a compatibility thing, however > I'm not sure offhand how easy it actually would be to detect whether such a > flag should be added or not. > > I know that iOS has an explicit way to find out whether the app is running > in the phone-style UI (iPhone, iPod Touch, and iPhone-targeted apps running > on iPad in compat mode) or the tablet-style UI (iPad). I don't know if > there's an equivalent on Android. > > > An alternative if that can't be shoehorned in upstream is to do a > JavaScript-side check while loading the regular web view; if we're in a > browser where CSS media queries detect a tiny mobile screen, and we don't > have a redirect preference cookie, then do the redirection after the fact. > (And optionally set a default state for the per-browser preference cookie so > we only have to do the test once instead of every visit?)
I like this idea and think that we could implement it well. Also, this seems like it would be a good solution moving forward. As, it would just continue to work without the need to constantly update UA detection, etc. > > -- brion > _______________________________________________ > Wikitech-l mailing list > Wikitech-l@lists.wikimedia.org > https://lists.wikimedia.org/mailman/listinfo/wikitech-l > _______________________________________________ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l