Page MenuHomePhabricator

MobileFrontend changed method of detecting if minerva skin is being used from javascript
Closed, ResolvedPublic

Description

Copying from gerrit review (since it's a post-merge review). I need to come up with a workable solution (doesn't have to restore wgMFMode, but needs to determine from javascript if minerva is active) before the branch cut on march 1st.

https://gerrit.wikimedia.org/r/#/c/268333/ looks to have changed when wgMFMode is sent to the users browsing session. Previously, from javascript, mw.config.get('wgMFMode') === null unless you are using the Minerva skin. After this patch wgMFMode is set for all pages regardless.
The issue here is that, because search is so different in mobile, we exclude it from the general search satisfaction schema. This exclusion is done by checking wgMFMode.
Could this be adjusted such that the old behaviour is retained, and wgMFMode is only set for the minerva skin?
For reference try mw.config.get('wgMFMode') on http://en.wikipedia.beta.wmflabs.org/wiki/Main_Page, https://test.wikipedia.org/wiki/Main_Page, and https://test.wikipedia.org/wiki/Main_Page?useskin=minerva

Event Timeline

wgMFMode probably should not be shipped to the desktop site. That seems like a regression (it should only be added where shouldDisplayMobileMode is true
If you care about whether it's Minerva though I would suggest using wgSkin === 'minerva'

Note other skins can run in mobile mode e.g. https://test.m.wikipedia.org/wiki/Main_Page?useskin=minerva&useformat=mobile&useskin=vector

Looks like we just need to throw in an shouldDisplayMobileView if statement

Change 273019 had a related patch set uploaded (by Bmansurov):
Add the 'wgMFMode' config variable to the page only in mobile mode

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

Change 273019 merged by jenkins-bot:
Add the 'wgMFMode' config variable to the page only in mobile mode

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

@EBernhardson did you need to swat this? It doesn't look like it but let me know if anything else is needed.

doesn't need to be swatted, the regression didn't make it into wmf.14