beehaw lemmy add home-instance name to username

beehaw lemmy add home-instance name to username 2

Verze ze dne 15. 06. 2023. Zobrazit nejnovější verzi.

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

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

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==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