Github.com - Extra header links - modified

Adds extra links in github header

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

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.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name        Github.com - Extra header links - modified
// @namespace   "zhouhao/github/header"
// @description Adds extra links in github header
// @include     https://github.com/*
// @version     2.1.3
// @grant       none
// ==/UserScript==

const nav = document.querySelectorAll('nav.d-flex')[0];
const className = 'js-selected-navigation-item Header-link mt-md-n3 mb-md-n3 py-2 py-md-3 mr-0 mr-md-3 border-top border-md-top-0 border-white-fade-15';

const createItem = (link, text) => {
    const myLink = document.createElement('a');
    myLink.href = '/' + link;
    myLink.setAttribute( 'class', className );
    myLink.innerHTML = text;
    nav.appendChild( myLink );
};

createItem('stars','Stars');
createItem('topics','Topics');

let user = document.querySelector('meta[name="user-login"]').content
createItem(user,user);