Last modified: 2014-02-12 23:46:10 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T38894, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 36894 - Mobile browser autodetection doesn't work
Mobile browser autodetection doesn't work
Status: RESOLVED FIXED
Product: MobileFrontend
Classification: Unclassified
Feature requests (Other open bugs)
unspecified
All All
: Low enhancement
: ---
Assigned To: Max Semenik
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-05-16 05:33 UTC by Quim Gil
Modified: 2014-02-12 23:46 UTC (History)
15 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Quim Gil 2012-05-16 05:33:14 UTC
After installing MobileFrontend (master-0880467 2012-05-15) and following the instructions described at http://www.mediawiki.org/wiki/Extension:MobileFrontend one would expect that at least mainstream mobile browser would be autodetected.

The fact is, autodetection only works if you "set up your configuration to mimic how things are done at the WMF (doing device detection at the proxy layer and setting specific X-Device headers)" http://www.mediawiki.org/wiki/Extension:MobileFrontend#Non-WMF_properties - Otherwise you and your users are left with a link for manual switch at the bottom  of the page.

With that information it is likely that many MW admins will fail at getting autodetection working.

Possible solutions:

- Provide instructions to set up a WMF mimic configuration.

- If the WMF solution is an overkill for the average MW installation and/or really complex for amateur sysadmins, please consider the addition of a poorman's autodetection. This should cover only the small group of mainstream user agents and hopefully an ability for sysadmins to add more UAs manually, based on the specific needs of their uses.

Would an approach like http://www.mediawiki.org/wiki/Extension:MobileDetect be useful in this scenario? If that extension is OK (I haven't tried it) it would be good to make it complementary of MF.
Comment 1 Max Semenik 2012-05-16 20:44:47 UTC
Yes, we really need to be able to automatically enable the mobile skin for mobile devices and mobile-specific URLs. But for that, we should be able to tell mobile devices from non-mobile ones because desktop Opera is currently detected as mobile WebKit, for example :P
Comment 2 Patrick Reilly 2012-05-16 21:47:32 UTC
Well, we do have:
$detector = new DeviceDetection();
$userAgent = $_SERVER['HTTP_USER_AGENT'];
$acceptHeader = isset( $_SERVER["HTTP_ACCEPT"] ) ? $_SERVER["HTTP_ACCEPT"] : '';
$formatName = $detector->detectFormatName( $userAgent, $acceptHeader );

We would just need to refactor for a non wmf mode to sent that return value as the xdevice.

— Patrick
Comment 3 Patrick Reilly 2012-05-16 21:47:56 UTC
s/sent/set/
Comment 4 Max Semenik 2012-05-16 21:56:00 UTC
The problem is that SeviceDetection can only tell one mobile platform from another, not mobile from non-mobile. For example:
* Opera, Safari & Chrome are detected as 'webkit',
* Firefox as 'capable'.
If you try to enable the mobile skin based on this information, you will always see it.
Comment 5 Max Semenik 2012-05-16 21:56:24 UTC
s/SeviceDetection/DeviceDetection/
Comment 6 Quim Gil 2012-05-17 05:26:32 UTC
"Opera Mini" and "Opera Mobi" can be detected from the User Agent without confusion, right?

"Fennec" (and "Minimo") should be good to detect the right Firefox mobile browsers. All the other mobile browsers have some string the UA that clearly marks them as mobile.

http://www.useragentstring.com/pages/Mobile%20Browserlist/

Or am I missing something?

WURFL is great to get all the heuristics but most MW sysdmins could do with a much more simpler and fuzzier list. No matter how imperfect this solution is, it will be better than letting users find the link at the bottom - and wishing they click it.
Comment 7 Jon 2012-06-14 21:59:12 UTC
I've started a fix for this:
https://gerrit.wikimedia.org/r/11569

It is incomplete but should deal with the problem
Comment 8 Jon 2012-09-13 23:54:28 UTC
Change above was abandoned. Patrick suggested having a meeting to thrash out
the details of how we can do this better.
Comment 9 Quim Gil 2012-10-10 17:40:23 UTC
Can you please explain the change from Major to Enhancement? Detecting mobile browsers seems to be a basic feature of the Mobile Extension, unless this problem is being solved by another piece of software.

I'm just trying to understand your approach to this problem. Thank you!
Comment 10 Jon 2012-10-10 17:58:29 UTC
We tend to use enhancement's for bugs that require thought and are not immediately actionable. We want this but someone needs to drive the work/conversations to make this happen - start sending patches or start or continue conversations about what should happen.

Anything that is not an enhancement in the mobile frontend extension in theory is urgent or should be actionable. bug 36936 is another great example - it's something that needs to be fixed but requires some sort of upfront design work to actually be fixed.

Really it's a workaround flaw in bugzilla which doesn't make it easy to distinguish between actionable bugs and more complicated bugs that need unravelling. If you have a better suggestion for separating these types of bugs I'd love to hear!
Comment 11 Quim Gil 2012-10-10 18:07:43 UTC
Thank you for the explanation, Jon. CCing Andre, our new Bug Wrangler. He might want to dig further on Bugzilla processes to address your point.
Comment 12 Brion Vibber 2012-10-10 20:44:00 UTC
The simplest thing we can do:

* check for 'Mobi' in the user-agent string
* blacklist if also contains 'iPad', since tablets currently want the desktop interface

(See recent talk on bug 40919 for instance.)


If there are modernish phones that don't have 'Mobile' in their UA string, I would be surprised... older ones I'm sure there are but they're less important for most third-party wiki users, probably.
Comment 13 Andre Klapper 2012-10-10 20:53:55 UTC
(In reply to comment #10)
> We tend to use enhancement's for bugs that require thought and are not
> immediately actionable.

If you use the term "bugs" here in the meaning of "not an enhancement request" I'd say: Just because a bug is harder to fix doesn't make it less of a bug by definition. ;)  Enhancement = new feature that would be nice to have.

What does "actionable" exactly mean? Fixable without too many thoughts and hence more trivial to fix?  I'd say that's what the severity field is for, plus the priority field exists to mark urgent tickets by setting it to "High" or "Highest".
Comment 14 Jon 2012-12-28 14:22:52 UTC
I think Ryan Lane's patch might take care of this (not confirmed)
Note: would add Ryan to cc list but there are 2 Ryan's and not sure which if either is him.
https://gerrit.wikimedia.org/r/40298
Comment 15 Max Semenik 2012-12-28 14:25:06 UTC
No, having detection work through an Apache module is good but not enough. Guess we can simply borrow the regexes from Squid ACLs.
Comment 16 Quim Gil 2012-12-29 06:56:51 UTC
Is this food for a possible project in a mentorship program or not quite?

http://www.mediawiki.org/wiki/Mentorship_programs/Possible_projects
Comment 17 eichi237 2012-12-31 16:34:39 UTC
You can use php-mobile-detect: https://code.google.com/p/php-mobile-detect/
Comment 18 eichi237 2012-12-31 16:45:41 UTC
It's not possible to use media queries?
Comment 19 Jon 2012-12-31 16:50:08 UTC
Reply to comment #18

Not relevant.

Currently there is a separate site for mobile. This is being built with mobile in mind and will use media queries to enhance itself for desktop browsing. Little work (that I know of) is happening on the desktop site to make it mobile friendly using media queries and this is the wrong way round as many older mobile devices do not support media queries whereas most modern (and used) desktop browsers do.

On the cluster we use addition software to determine whether to redirect a user to the mobile site or the desktop site based on their user agent. There is no default setup for this behaviour which is what this bug relates to.
Comment 21 Arthur Richards 2013-02-15 21:01:30 UTC
Merged.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links