Page MenuHomePhabricator

RL targets for gadget definition pages
Closed, ResolvedPublic


Currently, MediaWiki:Gadgets-definition allows setting targets= with default being just desktop.
But Gadget definition namespace pages don't allow setting targets. The default is desktop. There's no way to enable a gadget on mobile. This is a clear bug, and hence a blocker for gadget repo migration.

Possible solutions:

  1. Add targets option in gadget definition namespace. (A patch by @Lens0021 exists - Default remains just desktop.
  2. Add targets option but make the default desktop+mobile.
  3. In light of T127268, don't add a targets option and always use desktop+mobile. This means during the migration, all gadgets would start loading on mobile, likely causing increase in logged client-side errors (T262493)

Event Timeline

IMO gadgets need a target option, even if the target option for ResourceLoader modules in general goes away. The general recommendation is that the code adding/loading the module should check first if it's on mobile; there needs to be a way to do that in a gadget definition.


Please see T204201.

Capabilities to tailor gadget activation on current page context shall be extended, not cut back by this suggestion.

Change 616197 had a related patch set uploaded (by Lens0021; author: Lens0021):

[mediawiki/extensions/Gadgets@master] Add missing targets option

Tgr assigned this task to Lens0021.

Change 616197 merged by jenkins-bot:

[mediawiki/extensions/Gadgets@master] Add missing targets option