A partial archive of https://discourse-mediawiki.wmflabs.org as of Saturday May 21, 2022.

How does ResourceLoader determine the ‘target’?

Osnard

When implementing/defining a RL module one can set “targets” like “desktop” and “mobile”. Using my desktop the browsers (Chrome/Firefox) emulation features to view my wiki with a mobile device, RL modules with “target=mobile” get not delivered.

I’ve searched the implementation of RL and it looks like it is a parameter to load.php. But I did not find where it is being set.

HINT: I’ve got MobileFrontend NOT ENABLED.

Tgr

MobileFrontend sets it by calling OutputPage::setTarget.

Osnard

Thanks. I already assumed something like this. So without Extension:MobileFrontend no device/target recognition?

Tgr

Not in core, anyway. Something else could do it, but then which core modules target mobile is a bit of a mess. See this discussion.