Page MenuHomePhabricator

wgMobileDeviceName is not populated on en.m.wikipedia.org
Closed, ResolvedPublic

Description

Author: mwalker

Description:
The code mw.config.get( 'wgMobileDeviceName', 'desktop' ) returns "" on en.m.wikipedia.org both logged in and out when using Chrome spoofing as "Android 2.3" and "Android 4.0.2".

It should behave as like test.m.wikipedia.org where the same code returns "android".


Version: unspecified
Severity: normal

Details

Reference
bz47586

Event Timeline

bzimport raised the priority of this task from to Normal.Nov 22 2014, 1:32 AM
bzimport set Reference to bz47586.

the javascript doesn't seem to be varying anymore.

I can't see the vary header being set on the script containing the module mobile.xdevice.detect.script

Look in https://bits.wikimedia.org/m/en.wikipedia.org/load.php?debug=false&lang=en&modules=ext.centralNotice.bannerController.mobile%7Cjquery.client%2Ccookie%2CmwExtension%7Cmediawiki.notify%2Cutil%7Cmediawiki.page.startup%7Cmobile.xdevice.detect.scripts&skin=vector&version=20130424T025129Z&*

for mw.config.set("wgMobileDeviceName"

In mine at least it is being set to empty string. if I make the above url unique (e.g. append &cachebreak=true to url) I see mw.config.set("wgMobileDeviceName","webkit") on chrome as expected.

Css seems to be varying as per normal so that's a relief. The javascript not varying is not the end of the world...

Related URL: https://gerrit.wikimedia.org/r/61988 (Gerrit Change Ifbbd97830f0184eb843d616a7d2e70487169155c)

Related URL: https://gerrit.wikimedia.org/r/61989 (Gerrit Change If219c84d4755697ab849cfc083fa9234382f30f6)

This code probably makes more sense in CentralNotice on 2nd thoughts.

Note until https://gerrit.wikimedia.org/r/#/c/61989/ is merged there is a potential but highly unlikely race condition which might request a banner for unknown device types such a 'webkit'

https://gerrit.wikimedia.org/r/61989 (Gerrit Change If219c84d4755697ab849cfc083fa9234382f30f6) | change APPROVED and MERGED [by awjrichards]