I have $wgResponsiveImages = true; but on mobile I get no srcset.
This is primarily targeted at mobile and tablet browsers and some newer laptops such as the 'Retina' MacBook Pro.
This contradicts. How can I enable srcset on mobile devices?
MW 1.25
I have $wgResponsiveImages = true; but on mobile I get no srcset.
This is primarily targeted at mobile and tablet browsers and some newer laptops such as the 'Retina' MacBook Pro.
This contradicts. How can I enable srcset on mobile devices?
MW 1.25
I'm not sure I get no srcset on mobile.
On desktop, in the Chrome dev tools def not (window.devicePixelRatio = 2 tho).
Maybe it's jquery.hidpi.js being smarter and recognizing the emulation?
On mobile when "open the image" of a 180px thumb, the 360px thumb opens, so it seems to work.
MW 1.25, as said.
The jquery.hidpi module is a polyfill for implementing a subset of srcset selection at runtime on browsers that do not support it natively; it will thus not activate on any current modern browser. You may 100% ignore it for this reason.
The question is, are the srcset attributes present?
Try purging a page to determine whether the missing srcset attributes are an artifact of caching.
On desktop: Yes.
Chrome dev tools mobile device emulator: No.
On mobile device: How to check properly? "Open image" opens the 2x size.
Right now this is not configurable.
It is stripped as part of https://gerrit.wikimedia.org/r/#/c/271141/
It would be trivial to add a config setting wgMFResponsiveImages which defaults to false and is checked in the onThumbnailBeforeProduceHTML hook
Patches welcomed.
Change 286502 had a related patch set uploaded (by Brion VIBBER):
Add $wgMFStripResponsiveImages setting, defaulting back to off
I noticed that in the current code, there's no parser cache hash key change to distinguish between srcset-removal and non-srcset-removal mode. This meant that srcset got stripped depending on the view at *rendering time* not the view at *display time*.
Patch adds a parser key hash key tweak as well as the setting.
Change 286505 had a related patch set uploaded (by Jdlrobson):
Enable $wgMFStripResponsiveImages
https://www.mediawiki.org/wiki/HiDPI_display_support has some more background. (This was also mentioned in Tech News at some point.)
Change 286502 merged by jenkins-bot:
Add $wgMFStripResponsiveImages setting, defaulting on