User:Tks4Fish/CARedirect.js

From Meta, a Wikimedia project coordination wiki

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Press Ctrl-F5.
//Script for redirecting Special:CentralAuth pages on all wikis to the metawiki one
//by [[User:Tks4Fish]]

if( (mw.config.get('wgCanonicalSpecialPageName') == 'CentralAuth') && (mw.config.get('wgDBname') != 'metawiki') )
{
	window.location.replace('//meta.wikimedia.org/wiki/Special:CentralAuth/' + mw.config.get('wgRelevantUserName') );
}