jenkins-bot has submitted this change and it was merged.
Change subject: Don't set RL target in SkinPreloadExistence handler
......................................................................
Don't set RL target in SkinPreloadExistence handler
Instead set the mobile target inside the BeforePageDisplay handler, when
the mobile view should be displayed. This is a more natural place for
this anyway, given the other changes inside this hook.
Bug: T136651
Change-Id: I7c0de0691fd72d5a80c0c2aed12284dcca7402f7
---
M extension.json
M includes/MobileFrontend.hooks.php
2 files changed, 5 insertions(+), 20 deletions(-)
Approvals:
Phuedx: Looks good to me, approved
jenkins-bot: Verified
diff --git a/extension.json b/extension.json
index dc29546..3269dd9 100644
--- a/extension.json
+++ b/extension.json
@@ -1941,9 +1941,6 @@
"ResourceLoaderGetLessVars": [
"MobileFrontendHooks::onResourceLoaderGetLessVars"
],
- "SkinPreloadExistence": [
- "MobileFrontendHooks::onSkinPreloadExistence"
- ],
"ThumbnailBeforeProduceHTML": [
"MobileFrontendHooks::onThumbnailBeforeProduceHTML"
],
diff --git a/includes/MobileFrontend.hooks.php
b/includes/MobileFrontend.hooks.php
index 05e9c63..36eb347 100644
--- a/includes/MobileFrontend.hooks.php
+++ b/includes/MobileFrontend.hooks.php
@@ -399,23 +399,6 @@
}
/**
- * SkinPreloadExistence hook handler
- * Disables TOC in output before it grabs HTML
- * @see https://www.mediawiki.org/wiki/Manual:Hooks/SkinPreloadExistence
- *
- * @param Title[] $titles
- * @param Skin $skin
- * @return bool
- */
- public static function onSkinPreloadExistence( array &$titles, Skin
$skin ) {
- $context = MobileContext::singleton();
- if ( $context->shouldDisplayMobileView() &&
!$context->isBlacklistedPage() ) {
- $skin->getOutput()->setTarget( 'mobile' );
- }
- return true;
- }
-
- /**
* ResourceLoaderGetConfigVars hook handler
* This should be used for variables which:
* - vary with the html
@@ -858,6 +841,11 @@
// in mobile view: always add vary header
$out->addVaryHeader( 'Cookie' );
+ // set the mobile target
+ if ( !$context->isBlacklistedPage() ) {
+ $out->setTarget( 'mobile' );
+ }
+
// Allow modifications in mobile only mode
Hooks::run( 'BeforePageDisplayMobile', [ &$out, &$sk ]
);
--
To view, visit https://gerrit.wikimedia.org/r/295770
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I7c0de0691fd72d5a80c0c2aed12284dcca7402f7
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>
Gerrit-Reviewer: Phuedx <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits