Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Readd GitHub Releases Tab
- // @namespace https://greasyfork.org/en/users/85671-jcunews
- // @version 1.0.1
- // @license AGPLv3
- // @author jcunews
- // @description https://www.reddit.com/r/userscripts/comments/k39flt/request_releases_tab_for_github_userscript/
- // @match https://github.com/*/*
- // @grant none
- // ==/UserScript==
- (() => {
- document.querySelectorAll('a[href*="/releases"]').forEach((el, ctr, svg, nav, tab) => {
- if (ctr = el.querySelector(".Counter")) {
- svg = el.parentNode.parentNode.querySelector("svg");
- nav = document.querySelector(".UnderlineNav-body");
- (tab = document.createElement("LI")).className = "d-flex";
- tab.innerHTML = `
- <a class="js-selected-navigation-item UnderlineNav-item hx_underlinenav-item no-wrap js-responsive-underlinenav-item" data-tab-item="releases-tab" data-hotkey="g r">
- ${svg ? svg.outerHTML : ""}
- <span data-content="Releases">Releases</span>
- <span title="${ctr.title}" class="Counter ">${ctr.textContent}</span>
- </a>`;
- tab.firstElementChild.href = el.href;
- nav.insertBefore(tab, nav.children[1]);
- }
- });
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement