beehaw lemmy add home-instance name to username

beehaw lemmy add home-instance name to username 2

Versione datata 15/06/2023. Vedi la nuova versione l'ultima versione.

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// ==UserScript==
// @name        beehaw lemmy add home-instance name to username 
// @namespace   english
// @description  beehaw lemmy  add home-instance name to username 2
// @include     http*://*beehaw.org*
// @version     1.6
// @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() {


$( ".comments .text-info" ).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.*?@/ , '');

if(    homeinstance.search("beehaw.org")   == -1    ){ //show nothing if home-instance kbin 

console.log(homeinstance2 );
$(this).find('span').append( " - " +  homeinstance2  );

}



});


}); //end each username a href