Github.com - Extra header links - modified

Adds "Stars" link, as well as your user profile link, to the header alongside the existing "Pull Requests", "Issues" and "Gist" links.

2020-04-23 या दिनांकाला. सर्वात नवीन आवृत्ती पाहा.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==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.1.0
// @grant       none
// ==/UserScript==

var nav = document.querySelectorAll('nav.d-flex')[0];
var className = 'js-selected-navigation-item Header-link py-lg-3  mr-0 mr-lg-3 py-2 border-top border-lg-top-0 border-white-fade-15';
var starLink = document.createElement('a');
starLink.href = '/stars';
starLink.setAttribute( 'class', className );
starLink.innerHTML = 'Stars';

var topicLink = document.createElement('a');
topicLink.href = '/topics';
topicLink.setAttribute( 'class', className );
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', className );
userLink.innerHTML = user;

nav.appendChild( starLink );
nav.appendChild( topicLink );
nav.appendChild( userLink );