Guild Wars 2 Wiki:Requests for technical administration/Enable responsive image sizes on mobile

From Guild Wars 2 Wiki
Jump to navigationJump to search

Enable responsive image sizes on mobile[edit]

Originated from GW2W:BUG#srcset attribute missing for images on mobile devices.
Title
Enable responsive image sizes on mobile
Type
Amendment of LocalSettings.php
Reason
There is a phabricator ticket which details how the srcset tags are stripped out by mw:Extension:MobileFrontEnd for mobile viewers. On high resolution devices, this has the effect of rendering images as slightly blurry (degrades the user experience). Paraphrasing the phabricator wall of text; srcset attributes historically resulted in images being downloaded twice from the server - this was fixed in browsers years ago - however the mediawiki mobile code still removes the tags which exist on desktops as a kind of "optimisation" which is no longer required. Setting $wgMFStripResponsiveImages overrides this default behaviour and leaves the srcset attribute in place.
Instructions
Not applicable. This change has already been committed to the test version of this wiki (MW 1.38.2), and as such detailed instructions are not specified here (summarised; add $wgMFStripResponsiveImages = false; to LocalSettings.php.
Possible pitfalls
None identified.
Links