User:OneTwoThreeFall/common.js

//MediaWikiBacklink - Count of Howard //26-12-16 - Initial revision // modified to add link within title + remove API request $(function { //Cache mw variables  const mwVariables = mw.config.get([ 'wgPageName', 'wgNamespaceNumber' ]); //Specifically meant for MW pages  if (mwVariables.wgNamespaceNumber !== 8) {    return;  }  //Works for most cases when Dev wiki conventions are followed; ex:  //MediaWiki:ExampleScript.js or MediaWiki:ExampleScript/code.js  const redacted = mwVariables.wgPageName.split(/:(.+)/)[1].split(/[\/.]+/)[0];  const $title = $('.header-title > h1, #firstHeading');  const link = mw.html.element('a', { href: mw.util.getUrl(redacted), title: redacted }, redacted); $title.html($title.text.replace(redacted, link)); });