diff --git a/includes/Hooks.php b/includes/Hooks.php index 1c95d8f1..97a44015 100644 --- a/includes/Hooks.php +++ b/includes/Hooks.php @@ -122,6 +122,13 @@ class Hooks implements if ( !$extensionRegistry->isLoaded( 'EventLogging' ) ) { return false; } + if ( $extensionRegistry->isLoaded( 'MobileFrontend' ) ) { + $mobFrontContext = MediaWikiServices::getInstance()->getService( 'MobileFrontend.Context' ); + if ( $mobFrontContext->shouldDisplayMobileView() ) { + // on a MobileFrontend page the logging should be handled by it + return false; + } + } $inSample = $this->inEventSample( $data['editing_session_id'] ); $shouldOversample = $extensionRegistry->isLoaded( 'WikimediaEvents' ) && WikimediaEventsHooks::shouldSchemaEditAttemptStepOversample( $article->getContext() ); diff --git a/modules/ext.wikiEditor.js b/modules/ext.wikiEditor.js index dbf81746..c9656c0b 100644 --- a/modules/ext.wikiEditor.js +++ b/modules/ext.wikiEditor.js @@ -21,6 +21,12 @@ if ( mw.loader.getState( 'ext.eventLogging' ) === null ) { return; } + if ( mw.config.get( 'wgMFMode' ) !== null ) { + // Visiting a ?action=edit URL can, depending on user settings, result + // in the MobileFrontend overlay appearing on top of WikiEditor. In + // these cases, don't log anything. + return; + } var args = Array.prototype.slice.call( arguments ); mw.loader.using( [ 'ext.eventLogging' ] ).done( function () {