User:Mr. Stradivarius/gadgets/RandomRedirect.js

Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
/*                            RandomRedirect
 * 
 * This script adds a link to [[Special:RandomRedirect]] below the "Random
 * article" link in the navigation bar (on the top left in the Vector skin).
 * It also lets you load a random redirect with the keyboard shortcut Alt + Shift + I.
 * (The exact shortcut may vary depending on your system; you can hover over the link
 * to see what it is.)
 * 
 * To install, add the following to your [[Special:MyPage/common.js]]:

importScript('User:Mr. Stradivarius/gadgets/RandomRedirect.js') // Linkback: [[User:Mr. Stradivarius/gadgets/RandomRedirect.js]]

 */
 
 mw.loader.using( [ 'mediawiki.util' ], function () {
 	mw.util.addPortletLink(
		'p-navigation',
		mw.util.getUrl( 'Special:RandomRedirect' ),
		'Random redirect',
		'n-randomredirect',
		'Load a random redirect',
		'i',
		'#n-sitesupport'
	);
 } );