User:Nardog/CatChangeLinker.js

mw.config.get('wgAction') !== 'history' && mw.loader.using('mediawiki.util', function catChangeLinker {	mw.hook('wikipage.content').add($content => { $content.find('li.mw-changeslist-src-mw-categorize').each(function {			let titleLink = this.querySelector('.comment > a');			let title = titleLink ? titleLink.textContent : '';			let $diff = $(this.querySelector('.mw-changeslist-links > span')).wrapInner( $('').attr({					class: 'mw-changeslist-diff',					href: mw.util.getUrl(title, { diff: 'prev', oldid: this.dataset.mwRevid }),					title: title				}) );			if (!title) return;			$diff.next.wrapInner( $('').attr({					class: 'mw-changeslist-history',					href: mw.util.getUrl(title, { action: 'history' }),					title: title				}) );		});	}); });