From 7fb5663188ea68330018430650d3ab4c50277abe Mon Sep 17 00:00:00 2001 From: David Lynch Date: Fri, 7 Apr 2023 19:22:24 -0500 Subject: [PATCH] Don't hook CustomEditor for MobileFrontend requests Bug: T334263 Change-Id: I7ccf1ba7e8f227c236a6244bfa91a2b8a9fd5765 --- includes/Hooks.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/includes/Hooks.php b/includes/Hooks.php index fa54935a66..566806a05a 100644 --- a/includes/Hooks.php +++ b/includes/Hooks.php @@ -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 )