For readers of Tech News (October 2019):
Gadgets and user scripts can access variables about the current page in JavaScript. In 2015, this information was moved from global variables named wg* to mw.config. The old way via wg* global variables will be removed later this year.
To find out if a gadget or user script that you use is affected by this change, open the JavaScript console in your browser. If you see warnings like the below, then you are using a gadget or script that will stop working if the issue is not fixed:
The following may help with finding the problem script or with fixing the issue once once found:
- https://www.mediawiki.org/wiki/ResourceLoader/Migration_guide_(users)#Global_wg_variables
- https://meta.wikimedia.org/wiki/Tech
- https://www.mediawiki.org/wiki/Help:Locating_broken_scripts
If you want your wiki to be one of the first to try the new way that no longer has these global variables, leave a comment below. This can help find new issues that we may have missed. If your wiki choose to enable the new way, you can let us know to undo it if a problem is found.
Timeline
- Add option to disable legacy globals: wgLegacyJavaScriptGlobals. – T30916, 49ce5de7d94 (MediaWiki 1.17 in 2011)
- Add deprecation notices for accessing mw.config.get() when wgLegacyJavaScriptGlobals is enabled. – T58550, 24f84b08cf91ef (MediaWiki 1.25 in 2014)
- Turn it off by default in MediaWiki core. – T35837 (in release 1.35)
- Mark it deprecated (in release 1.36)
- Migrate usage and gradually disable on Wikimedia wikis:
- Turn it off on test2.wikipedia.org. – T67011, bbfba08d31 (2014)
- Fix the Collection extension to not depend on these. T177259
- Turn it off on group0 wikis. (test.wikipedia.org, mediawiki.org, and read-only wikis)
- Turn it off for developers and in Continuous Integration for code merges. (DevelopmentSettings)
- Turn it off on Beta Cluster for all wikis.
- Turn it off on group1 wikis. (mostly non-Wikipedia)
- Turn it off everywhere. (+group2: Wikipedia)
- Remove the feature. – (in release 1.37 or later)