Jump to content

User:Danski454/WhoisSidebar.js

From Wikipedia, the free encyclopedia
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.
if ((mw.config.get( 'wgNamespaceNumber' ) === 3 || mw.config.get( 'wgPageName' ).startsWith("Special:Contributions")) && (/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/.test(mw.config.get( 'wgRelevantUserName' )) || /^(?:[0-9a-f]{0,4}:)+[0-9a-f]{0,4}$/i.test(mw.config.get( 'wgRelevantUserName' )))) {  // Only for IP talk and contirbution pages

	// Create link
	$('#p-tb .body ul').append('<li><a class="WHOIS1"></a></li>');

	// Set link's text and url
	$('.WHOIS1').text('Whois').attr('href', 'http://whois.domaintools.com/' + mw.config.get( 'wgRelevantUserName' ) );
}