// ==UserScript== // @name Github加速clone // @namespace http://tampermonkey.net/ // @version 0.1 // @description Github 加速 clone // @author d1y // @match https://github.com/* // @grant none // @require https://cdn.bootcdn.net/ajax/libs/jquery/2.1.4/jquery.min.js // @downloadURL https://update.greasyfork.icu/scripts/415947/Github%E5%8A%A0%E9%80%9Fclone.user.js // @updateURL https://update.greasyfork.icu/scripts/415947/Github%E5%8A%A0%E9%80%9Fclone.meta.js // ==/UserScript== (function () { /** * 非盈利性质机构提供 * * https://fastgit.org * * https://github.com/FastGitORG */ const fastgithub_url = "https://hub.fastgit.org"; /* * 淘宝提供的镜像服务 * * https://github.com/cnpm */ let cnpmjs_url = "https://github.com.cnpmjs.org"; // url let url = window.location.href; let url_data = url.split("/"); let github_auth_name = url_data[3]; let git_name = url_data[4]; ;(function () { addCloneButton(); addSiteButton(); })() /** * 添加镜像站点按钮 */ function addSiteButton() { const title = "淘宝镜像" let template = `
${title}
`; $(".file-navigation").append(template); } /** * 添加克隆按钮 */ function addCloneButton() { let template = `
加速
`; $(".file-navigation").append(template); } })();