kbin social add home-instance name to username

kbin social add home -instance name to username

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name        kbin social add home-instance name to username 
// @namespace   english
// @description  kbin social add home -instance name to username 
// @include     http*://*kbin.social*
// @include     http*://*beehaw.org*
// @version     1.16
// @run-at document-end
// @require       https://cdn.jsdelivr.net/npm/jquery@3/dist/jquery.min.js
// @license MIT
// @grant       GM_addStyle
// ==/UserScript==


// Main - redirect test 

 // A $( document ).ready() block.
$( document ).ready(function() {


$( ".user-inline" ).each(function() {
 // $( this ).addClass( "foo" );
// get username URL and text, then remove username from URL and paste the instance name after username (not if instance is home-instance of kbin.social

var homeinstance = $(this).attr('href') ;    

var myname = $(this).text().trim();

//console.log( "@@@");
//console.log(homeinstance );
//console.log(myname );

var homeinstance2 =  homeinstance.replace( "/u/@" + myname + "@"  , '');

if(   homeinstance2  !=   "/u/" + myname     ){ //show nothing if home-instance kbin 

console.log(homeinstance2 );
$(this).append( " <i>- " +  homeinstance2 +"</i>" );

}



});


}); //end each username a href




//css color for added text - dark and light modes 

var style = document.createElement('style');
style.type = 'text/css';
style.innerHTML =   '     #content a.user-inline i{color: #c63434;}body.theme--dark #content a.user-inline i{color: #ffabc3  !important ;}      ' ;

document.getElementsByTagName('head')[0].appendChild(style);