User talk:WhatamIdoing/common.js

From mediawiki.org
Latest comment: 3 years ago by Jdlrobson in topic Legacy JavaScript

Legacy JavaScript[edit]

Hello! This script has been detected as using deprecated parameters that need to be replaced with the updated version. Examples include addOnloadHook() needs to be replaced with $(); all wgGlobalVariables need to be properly gotten with mw.config.get( 'wgGlobalVariable' ); and addPortletLink needs to be called with mw.util.addPortletLink. Please see MW:ResourceLoader/Legacy JavaScript for details. Thank you. Technical 13 (talk) 18:31, 18 January 2015 (UTC)Reply

Hey user:WhatamIdoing - given this throws an error every page visit you make this, unfortunately, has the potential for leaking information about your viewing habits so definitely something to pay attention to it.
You can fix this by adding the following to the top of your user script:
var wgNamespaceNumber = mw.config.get('wgNamespaceNumber'), wgTitle = mw.config.get('wgTitle');

Jdlrobson (talk) 20:53, 18 August 2020 (UTC)Reply