Greasy Fork is available in English.
Adds "Stars" link, as well as your user profile link, to the header alongside the existing "Pull Requests", "Issues" and "Gist" links.
Устаревшая версия за
// ==UserScript==
// @name Github.com - Extra header links - modified
// @namespace
// @description Adds "Stars" link, as well as your user profile link, to the header alongside the existing "Pull Requests", "Issues" and "Gist" links.
// @include https://github.com/*
// @version 2.0.0
// @grant none
// ==/UserScript==
var nav = document.querySelectorAll('nav.d-flex')[0];
var starLink = document.createElement('a');
starLink.href = '/stars';
starLink.setAttribute( 'class', 'js-selected-navigation-item Header-link mr-3' );
starLink.innerHTML = 'Stars';
var topicLink = document.createElement('a');
topicLink.href = '/topics';
topicLink.setAttribute( 'class', 'js-selected-navigation-item Header-link mr-3' );
topicLink.innerHTML = 'Topics';
var user = document.getElementsByClassName('user-profile-link');
if(user && user.length > 0) {
user = user[0].childNodes[1].textContent;
} else {
user = document.getElementsByClassName('css-truncate-target')[0].textContent;
}
var userLink = document.createElement('a');
userLink.href = '/' + user;
userLink.setAttribute( 'class', 'js-selected-navigation-item Header-link mr-3' );
userLink.innerHTML = user;
nav.appendChild( starLink );
nav.appendChild( topicLink );
nav.appendChild( userLink );