Page MenuHomePhabricator

Move DeviceDetection.php from MobileFrontend to core
Open, Needs TriagePublic

Description

Other parts of MediaWiki besides MobileFrontend need the ability to detect device type, for example, for logging or skinning or enabling certain UI interactions. Let's move the DeviceDetection class from MobileFrontend into core so that we don't have to reinvent the wheel.

Event Timeline

What, again? :P It was in the core at some point, was moved back because only MF used it anyway.

Hey @MaxSem, nice to see you! Yes, it was in core originally, and there is a bit of a chicken and egg problem, as I mentioned in T100402#6057011. In order to fix T249944, we need to move it back to core though. It would also be useful for other cases (see T100402). What do you think?

Change 680460 had a related patch set uploaded (by Mholloway; author: Michael Holloway):

[mediawiki/core@master] Move device detection from MobileFrontend into core

https://gerrit.wikimedia.org/r/680460

This would also be useful for some of the work we're doing to improve product analytics instrumentation. Reviews welcome on the change above from anyone interested in seeing this get done. I'll follow up with a change to MobileFrontend to use the functionality from core.

Change 680461 had a related patch set uploaded (by Mholloway; author: Michael Holloway):

[mediawiki/extensions/MobileFrontend@master] Use device detection from MediaWiki core

https://gerrit.wikimedia.org/r/680461

Change 680460 abandoned by Mholloway:

[mediawiki/core@master] Move device detection from MobileFrontend into core

Reason:

Thanks Krinkle for the thoughts and DannyS712 for the review. I'm convinced we don't want this as is for the reasons mentioned, so I think I'll abandon this for the time being and put some thought into a more focused approach for EL based on the ua-parser library, as suggested.

https://gerrit.wikimedia.org/r/680460

Change 680461 abandoned by Mholloway:

[mediawiki/extensions/MobileFrontend@master] Use device detection from MediaWiki core

Reason:

See discussion on parent.

https://gerrit.wikimedia.org/r/680461