Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions src/Chameleon.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,6 @@ public static function init() {
}
}

/**
* @param OutputPage $out
*/
public function initPage( OutputPage $out ) {
parent::initPage( $out );

// Enable responsive behaviour on mobile browsers
$out->addMeta( 'viewport', 'width=device-width, initial-scale=1, shrink-to-fit=no' );
Copy link
Contributor

@malberts malberts Jul 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is based on Bootstrap 4's recommended meta tag:
https://getbootstrap.com/docs/4.6/getting-started/introduction/#responsive-meta-tag

Can you confirm that the difference between that and MediaWiki's tag does not cause issues or changes in mobile behavior?

..., shrink-to-fit=no"/>
..., user-scalable=yes, minimum-scale=0.25, maximum-scale=5.0"/>

(from #470 (comment))

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW, my (limited) understanding is that shrink-to-fit is a 10-year-old Safari-specific "band-aid": https://www.scottohara.me/blog/2018/12/11/shrink-to-fit.html

Conversely, user-scalable=yes is the default value for viewport meta tags. (And the default min/max are 0.1 and 10, according to MDN.)

(As far as real-world testing, all I did is check that the PR made my observed misbehavior go away, on a handful of browsers on Android.)

}

/**
* @inheritDoc
*/
Expand Down
1 change: 1 addition & 0 deletions src/Hooks/SetupAfterCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ function () {
return new Chameleon( [
'name' => 'chameleon',
'styles' => $styles,
'responsive' => true,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a new MediaWiki feature? Since when is it available?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's been there "for a while". As far as Chameleon support is concerned, it's available in MW 1.39+.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From a quick git blame, it looks like emitting the viewport tag for a true responsive option goes back to at least 2020-08-03 (204ddf052296), and emitting the fixed-width viewport tag for the non-responsive case was first added 2 years later, in 2022-05-09 (f5afb5c48c9a). (So, 2022-05 is when the two competing viewport tags would have started appearing in the HTML output with Chameleon.)

'bodyOnly' => true
] );
} );
Expand Down