Don't hook CustomEditor for MobileFrontend requests

Bug: T334263
Change-Id: I7ccf1ba7e8f227c236a6244bfa91a2b8a9fd5765
This commit is contained in:
David Lynch 2023-04-07 19:22:24 -05:00 committed by Bartosz Dziewoński
parent 3918f80a72
commit 7fb5663188

View file

@ -356,6 +356,14 @@ class Hooks {
$services = MediaWikiServices::getInstance();
$veConfig = $services->getConfigFactory()->makeConfig( 'visualeditor' );
if ( ExtensionRegistry::getInstance()->isLoaded( 'MobileFrontend' ) ) {
// If mobilefrontend is involved it can make its own decisions about this
$mobFrontContext = MediaWikiServices::getInstance()->getService( 'MobileFrontend.Context' );
if ( $mobFrontContext->shouldDisplayMobileView() ) {
return true;
}
}
if (
!self::enabledForUser( $user ) ||
self::isUAUnsupported( $req, $veConfig )