Allow pinch to zoom when reading articles - #6538
Open
folecr wants to merge 2 commits into
Open
Conversation
folecr
force-pushed
the
st/pinch_to_zoom_article_webview
branch
from
May 14, 2026 17:23
2cf9d4b to
4b6ab0e
Compare
folecr
force-pushed
the
st/pinch_to_zoom_article_webview
branch
from
May 26, 2026 16:25
4b6ab0e to
ff373a4
Compare
* Enable zooming in WebView configuration * Replace the meta viewport content tag with what is served to mobile web * ... by https://github.com/wikimedia/mediawiki/blob/master/includes/Skin/Skin.php#L386 * ... `content="width=device-width, initial-scale=1.0, user-scalable=yes, minimum-scale=0.25, maximum-scale=5.0"` Bug : T424079
folecr
force-pushed
the
st/pinch_to_zoom_article_webview
branch
from
June 29, 2026 18:12
ff373a4 to
51a1e1c
Compare
Author
|
Gate change behind a developer settings flag as in wikimedia/wikipedia-ios#5821 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
content="width=device-width, initial-scale=1.0, user-scalable=yes, minimum-scale=0.25, maximum-scale=5.0"Bug : T424079
What does this do?
Allow pinch to zoom in the article webview in Wikipedia Android
I frequently use pinch to zoom on the web (both desktop and mobile) to zoom into article text or images without relayout of the entire article webpage but the mobile app does not allow usage of this gesture. This PR allows using pinch-to-zoom in the mobile app exclusively in the article webview.
Note : corresponding iOS PR wikimedia/wikipedia-ios#5821
Note : On Android the webview cannot be configured to ignore viewport scale limits so this change requires modifying HTML content with
user-scalable=yesbefore loading in webview.A broader, perhaps more correct fix, is to set user-scalable=yes in the content being served. It looks like user-scalable in the HTML content being served is being set by https://github.com/wikimedia/mediawiki-services-mobileapps/blob/master/lib/transformations/pcs/head.js#L71 introduced in change b3bed0a05861401f83d84e93d436d08bb77da1c4. If there is interest in doing so, I could potentially make a change in that repo if there is consensus that it is the right spot, instead of this repo.
Why is this needed?
When browsing wikipedia on mobile web and desktop web browsers, users may zoom into content with the pinch to zoom gesture. However this is not currently possible in app. This PR enables the same functionality in the wikipedia mobile app, for articles.
Note W3C recommendation https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/meta/name/viewport#user-scalable
Phabricator:
https://phabricator.wikimedia.org/T424079