Github.com - Extra header links - modified

Adds extra links in github header

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

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