您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
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 );