Commons:Gadgets

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search
The Gadget tab of Preferences on French Wikipedia

Gadgets are standard user scripts which extend the functionality of MediaWiki, the software on which Commons runs, and are available to easily install via a user's Preferences. (Other user scripts are available which must be installed manually.) Individual gadgets can be activated or deactivated (some are activated by default) by visiting your Preferences (you must be logged in) and ticking the relevant box. Most gadgets require JavaScript to be enabled in your browser.

Technical details

Definition

  • MediaWiki:Gadgets-definition is where gadgets are installed so that they show up in Preferences
    • Gadgets can be restricted to users with certain user rights by adding, for example, rights=delete in the gadget definition. Gadgets are loaded by default (including for users not logged in) by adding default. Gadgets can be restricted to logged-in users with rights=upload.
  • Special:Gadgets provides an overview of installed gadgets, with links to the gadgets' script files
  • MediaWiki:Common.js loads some scripts automatically

Localization

Templates

Limitations

Since MediaWiki 1.18, gadgets (and user CSS/JS) are not loaded on certain special pages, for security reasons. This includes Special:Preferences, breaking the previous means of moving gadgets to other parts of the Preferences. See phab:T20186. phab:T35220 requests a native MediaWiki replacement for what was previously done in Javascript.