// ==UserScript== // @name Github Find Active Forks // @name:zh-CN Github查找活跃的Forks列表 // @namespace http://tampermonkey.net/ // @version 1.0 // @description allows you to find the most active forks of a repository. // @description:zh-CN Github显示活跃的Forks列表,可以快速了解各个分叉的热度,比如在主项目存档不维护时,就能知道有哪个新分叉有更新, // @author AndyWu // @homepageURL https://github.com/andywu188/ // @match https://github.com/* // @run-at document-end // @grant none // @license LGPLv3 // @downloadURL https://update.greasyfork.icu/scripts/429795/Github%20Find%20Active%20Forks.user.js // @updateURL https://update.greasyfork.icu/scripts/429795/Github%20Find%20Active%20Forks.meta.js // ==/UserScript== (function () { 'use strict' function applyNodeActivefork () { var activeforkNode = document.querySelector("#active-forks-button-repo"); if (activeforkNode == null) { var pageheadaction = document.querySelector(".pagehead-actions"); if (pageheadaction != null) { var tempNode = document.createElement('li'); var repositoryLinkNode = document.querySelector("main .hx_page-header-bg .mr-2 a"); if (repositoryLinkNode != null) { var repositoryLink = repositoryLinkNode.href; tempNode.innerHTML = '
Active Forks
'; pageheadaction.appendChild(tempNode); } } } } var main = document.querySelector('main'); if (main != null) { var observer = new MutationObserver(function (mutations, observer) { applyNodeActivefork(); }) observer.observe(main, { childList: true }) applyNodeActivefork(); } })()