https://gerrit.wikimedia.org/r/c/operations/mediawiki-config/+/966798 removed the sole caller of EnterMobileMode (as far as codesearch can tell).
Historically there were a couple non-CentralAuth-related uses (rOMWC355a2710231f: Direct mobile banner requests to mobile site for CentralNotice, rEULSfd885d988112: Initial support for webfonts in MobileFrontend for UniversalLanguageSelector, the never merged rOMWCaec20bade127: Log more Navigation Timing events on mobile for NavigationTiming) but those didn't survive.
The hook was added in rEMFRc5228db3de98: New hook EnterMobileMode to "inform other extensions that we're going to have a mobile page view"; that use case makes sense, but the hook doesn't serve it well, because it's called at an unpredictable point in time, leading to issues like rOMWCf8ad56ce4d8a: Better hack for T49647. I think it would be better to just expose MobileContext::shouldDisplayMobileViewInternal() and internalize setForceMobileView(), which only has a single caller.
Most extensions these days are using:
$isMobileView = ExtensionRegistry::getInstance()->isLoaded( 'MobileFrontend' ) && $services->getService( 'MobileFrontend.Context' )->shouldDisplayMobileView(); if ( $isMobileView ) { .. }
TODO
- Remove EnterMobileMode
- Mark BeforePageDisplayMobile as soft deprecated.
- Update Wikistories and Wikidata
- Hard deprecate BeforePageDisplayMobile
"DeprecatedHooks": { "GetMobileUrl": { "deprecatedVersion": "1.42", "component": "MobileFrontend" }, "BeforePageDisplayMobile": { "deprecatedVersion": "1.43", "component": "MobileFrontend" } },
- Wait one deploy cycle
- Remove.