Greasy Fork is available in English.

YouTube to Social Blade Linker

Adds a plain-text link to YouTube profile pages that links to the corresponding Social Blade page for that channel, with a hover effect to match the YouTube font and color design.

// ==UserScript==
// @name         YouTube to Social Blade Linker
// @namespace    https://your-namespace-here/
// @version      1
// @description  Adds a plain-text link to YouTube profile pages that links to the corresponding Social Blade page for that channel, with a hover effect to match the YouTube font and color design.
// @author       webmaster.greasyfork
// @match        https://www.youtube.com/@*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Get the username from the YouTube profile page URL
    const username = window.location.href.match(/youtube\.com\/@(.+)/i)[1];

    // Create a link element and append it to the body of the page
    const link = document.createElement('a');
    link.innerText = 'Social Blade';
    link.href = `https://socialblade.com/youtube/channel/${username}`;
    link.target = '_blank'; // Open link in a new tab
    link.style.position = 'fixed';
    link.style.bottom = '10px';
    link.style.right = '10px';
    link.style.backgroundColor = 'transparent';
    link.style.color = '#606060';
    link.style.fontFamily = 'Roboto, Arial, sans-serif';
    link.style.fontSize = '16px';
    link.style.textDecoration = 'none';
    link.style.padding = '12px';
    link.addEventListener('mouseover', () => {
        link.style.backgroundColor = '#272727';
        link.style.color = '#ffffff';
    });
    link.addEventListener('mouseout', () => {
        link.style.backgroundColor = 'transparent';
        link.style.color = '#606060';
    });
    document.body.appendChild(link);

    // Add support for ALT + 1 key to trigger clicking the Social Blade button
    document.addEventListener('keydown', function(event) {
        if (event.altKey && event.key === '1') {
            event.preventDefault();
            link.click();
        }
    });
})();