User:DannyS712/errors.js
// Install with:
//
// or with
//
//
// Special thanks to User:Enterprisey and their script, User:Enterprisey/user-tabs-on-contribs.js, which I partially forked.
// If forking this script, please note my contributions / give me credit
/*** Only add if "Main Page" is in page title, and not already on errors (or errors talk) page ***/
if( mw.config.get( "wgPageName" ).indexOf( "Main_Page" ) > -1
&& mw.config.get( "wgPageName" ).indexOf("Main_Page/Errors") == -1
) {
console.log(mw.config.get( "wgPageName" ));
mw.loader.using( 'mediawiki.util',
function () {
var $link = $( "" )
.text( "Errors" )
.attr( "title", "Wikipedia:Main Page/Errors" )
.attr( "href", mw.util.getUrl( "Wikipedia:Main Page/Errors" ) );
var isNewVector = mw.config.get('skin') == 'vector-2022';
if ( !isNewVector ) {
$link = $( "" ).append( $link );
}
$link = $( "
.attr( "id", "ca-errors" );
if ( isNewVector ) {
$link.addClass( "vector-tab-noicon" ).addClass( "mw-list-item" );
}
$( "#ca-talk" ).after( $link );
}
);
}