Github Navigation Bar For Self

导航栏增加Home、Repo、Discover、Trending、Topics、Stars

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

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.

ستحتاج إلى تثبيت إضافة مثل Stylus لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتتمكن من تثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

(لدي بالفعل مثبت أنماط للمستخدم، دعني أقم بتثبيته!)

// ==UserScript==
// @name         Github Navigation Bar For Self
// @version      1.0.5
// @description  导航栏增加Home、Repo、Discover、Trending、Topics、Stars
// @author       windnight
// @include     /^https?://((blog|gist|guides|help|raw|status|developer)\.)?github\.com/((?!generated_pages\/preview).)*$/
// @include      /^https://github.com/*$/
// @include     /^https://*.githubusercontent.com/*$/
// @include     /^https://*graphql-explorer.githubapp.com/*$/
// @require      https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js
// @run-at       document-end
// @namespace https://greatest.deepsurf.us/users/222560
// ==/UserScript==

var $ = $ || window.$;

window.jQuery = $;

$(document).ready(function(){
    $('.flex-items-center .header-nav-item').remove();
    var profile =document.getElementsByTagName("meta")["user-login"].getAttribute("content");//$("meta[name='user-login']").content;// $('.header-nav-current-user .user-profile-link').attr('href');

    //$('nav').filter(".d-flex .flex-column .flex-lg-row .flex-self-stretch .flex-lg-self-auto").append(`
    //$('nav').append(`
    $('nav').filter(".d-flex").append(`
        <a class="js-selected-navigation-item Header-link flex-auto 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" data-ga-click="Header, click, Nav menu - item:profile" href="https://github.com/`+ profile +`">Home</a>
        <a class="js-selected-navigation-item Header-link flex-auto 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" data-ga-click="Header, click, Nav menu - item:home" href="https://github.com/`+ profile +`?tab=repositories">Repo</a>
        <a class="js-selected-navigation-item Header-link flex-auto 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" data-ga-click="Header, click, Nav menu - item:discover" href="https://github.com/discover">Discover</a>
        <a class="js-selected-navigation-item Header-link flex-auto 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" data-ga-click="Header, click, Nav menu - item:trending" href="https://github.com/trending">Trending</a>
        <a class="js-selected-navigation-item Header-link flex-auto 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" data-ga-click="Header, click, Nav menu - item:topics" href="https://github.com/topics">Topics</a>
        <a class="js-selected-navigation-item Header-link flex-auto 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" data-ga-click="Header, click, Nav menu - item:stars" href="/guanguans?tab=stars">Stars</a>
        <a class="js-selected-navigation-item Header-link flex-auto 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" data-ga-click="Header, click, Nav menu - item:gist" href="https://gist.github.com">Gist</a>
        <a class="js-selected-navigation-item Header-link flex-auto 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" data-ga-click="Header, click, Nav menu - item:gitbook" href="https://app.gitbook.com">Gitbook</a>

    </div>
    `);
});