From bd6a2af7f2412495c3b2a221d030cb82c1474d74 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Thu, 18 Nov 2021 18:12:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E4=BB=A3=E7=A0=81;=20?= =?UTF-8?q?=E7=A7=BB=E9=99=A4=20=E6=97=A7=E7=89=88=20Release=20=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E7=9A=84=E6=94=AF=E6=8C=81=20(Github=20=E5=B7=B2?= =?UTF-8?q?=E5=AE=8C=E5=85=A8=E6=9B=B4=E6=96=B0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GithubEnhanced-High-Speed-Download.user.js | 138 +++++---------------- 1 file changed, 34 insertions(+), 104 deletions(-) diff --git a/GithubEnhanced-High-Speed-Download.user.js b/GithubEnhanced-High-Speed-Download.user.js index 2e336f9..70e68fd 100644 --- a/GithubEnhanced-High-Speed-Download.user.js +++ b/GithubEnhanced-High-Speed-Download.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name Github 增强 - 高速下载 -// @version 1.6.6 +// @version 1.6.7 // @author X.I.U // @description 高速下载 Git Clone/SSH、Release、Raw、Code(ZIP) 等文件、项目列表单文件快捷下载 (☁) // @match *://github.com/* @@ -21,34 +21,28 @@ (function() { 'use strict'; - var backColor = '#ffffff'; - var fontColor = '#888888'; + var backColor = '#ffffff', fontColor = '#888888'; if (document.getElementsByTagName('html')[0].getAttribute('data-color-mode') === 'dark') { // 黑暗模式判断 if (document.getElementsByTagName('html')[0].getAttribute('data-dark-theme') === 'dark_dimmed') { - backColor = '#272e37'; - fontColor = '#768390'; + backColor = '#272e37'; fontColor = '#768390'; } else { - backColor = '#161a21'; - fontColor = '#97a0aa'; + backColor = '#161a21'; fontColor = '#97a0aa'; } } else if (document.getElementsByTagName('html')[0].getAttribute('data-color-mode') === 'auto') { - //console.log(window.getComputedStyle(document.body).backgroundColor) if (window.getComputedStyle(document.body).backgroundColor === 'rgb(34, 39, 46)') { - backColor = '#272e37'; - fontColor = '#768390'; + backColor = '#272e37'; fontColor = '#768390'; } else if (window.getComputedStyle(document.body).backgroundColor === 'rgb(13, 17, 23)') { - backColor = '#161a21'; - fontColor = '#97a0aa'; + backColor = '#161a21'; fontColor = '#97a0aa'; } } const download_url = [ - ['https://gh.api.99988866.xyz', '美国 1'], - ['https://github.91chifun.workers.dev', '美国 2'], - ['https://gh.xiu2.xyz', '美国 3'], + ['https://gh.api.99988866.xyz/https://github.com', '美国 1'], + ['https://github.91chifun.workers.dev/https://github.com', '美国 2'], + ['https://gh.xiu2.xyz/https://github.com', '美国 3'], ['https://github.rc1844.workers.dev', '美国 4'], - ['https://pd.zwc365.com/seturl', '美国 5'], + ['https://pd.zwc365.com/seturl/https://github.com', '美国 5'], ['https://download.fastgit.org', '日本'], - ['https://ghproxy.com', '韩国'] + ['https://ghproxy.com/https://github.com/', '韩国'] ], clone_url = [ ['https://hub.fastgit.org', '中国香港'], @@ -132,89 +126,28 @@ // Release function addRelease() { - let html = document.getElementsByClassName('Box-footer');//if (html.length == 0) return + let html = document.getElementsByClassName('Box-footer'); if (html.length == 0) return let divDisplay = ''; - if (html.length > 0) { - if (document.documentElement.clientWidth > 1000) {divDisplay = 'float: right;margin-top: -3px;margin-left: 8px;';}; // 调整小屏幕下样式 - Array.from(html).forEach(function (current) { - current.querySelectorAll('li.Box-row > a').forEach(function (_this) { - let href = _this.href.split(location.host), - url = [], - _html = `