|
1 | 1 | // ==UserScript== |
2 | 2 | // @name Github 增强 - 高速下载 |
3 | | -// @version 1.1.2 |
| 3 | +// @version 1.1.3 |
4 | 4 | // @author X.I.U |
5 | 5 | // @description 为 Github 的 Clone、Release、Raw、Code(ZIP) 添加高速下载 |
6 | 6 | // @match https://github.com/*/* |
|
29 | 29 | var clone_url2 = "https://gitclone.com"; // 中国浙江杭州 |
30 | 30 | var clone_url3 = "https://ghp.lvmhsh.cn.cnpmjs.org"; // 新加坡 |
31 | 31 |
|
32 | | - // 这里这里 |
33 | | - var raw_fast = "中国国内"; // 指定各个文件名后的云朵使用的高速下载链接,选择范围:[Github、中国国内、中国香港、美国洛杉矶],各加速源注意事项看下面,自行选择 |
34 | | - // 这里这里 |
| 32 | + // 这里这里~~ |
| 33 | + var raw_fast = "中国国内"; // 指定各个文件名后的云朵使用的高速下载链接,选择范围:[Github、中国国内、中国香港、美国洛杉矶],各加速源注意事项看下面,自行选择~~ |
| 34 | + // 这里这里~~ |
35 | 35 |
|
36 | 36 | var raw_url0 = "https://raw.githubusercontent.com"; |
37 | 37 | var raw_url0_name = "Github"; // 原生链接 |
|
69 | 69 | var url3 = download_url3 + '/github.com' + href; |
70 | 70 | var url4 = download_url4 + '/github.com' + href; |
71 | 71 | var url5 = download_url5 + '/github.com' + href; |
72 | | - var html1 = `<div style="display: flex;justify-content: flex-end;flex-grow: 1;"> |
73 | | -<div><span style="font-size: 12px;color: #586069;line-height: 23px;">高速下载:</span></div> |
| 72 | + var html1 = `<div style="display: flex;justify-content: flex-end;"> |
74 | 73 | <div><a style="${download_release_style}" class="btn" href="${url1}" rel="nofollow">${download_url1_name}</a></div> |
75 | 74 | <div><a style="${download_release_style}" class="btn" href="${url2}" rel="nofollow">${download_url2_name}</a></div> |
76 | 75 | <div><a style="${download_release_style}" class="btn" href="${url3}" rel="nofollow">${download_url3_name}</a></div> |
77 | 76 | <div><a style="${download_release_style}" class="btn" href="${url4}" rel="nofollow">${download_url4_name}</a></div> |
78 | 77 | <div><a style="${download_release_style}" class="btn" href="${url5}" rel="nofollow">${download_url5_name}</a></div> |
79 | 78 | </div>`; |
80 | | - $(this).after(html1); |
| 79 | + $(this).next().after(html1); |
81 | 80 | }); |
| 81 | + // 修改[文件大小]元素样式 |
| 82 | + document.querySelectorAll('small.pl-2.text-gray.flex-shrink-0').forEach(el=>el.style.cssText='display: flex; justify-content: flex-end; flex-grow: 1; margin-right: 8px;'); |
82 | 83 |
|
83 | 84 |
|
84 | 85 | // Source Code 加速 |
|
90 | 91 | var url4 = download_url4 + '/github.com' + href; |
91 | 92 | var url5 = download_url5 + '/github.com' + href; |
92 | 93 | var html1 = `<div style="display: flex;justify-content: flex-end;flex-grow: 1;"> |
93 | | -<div><span style="font-size: 12px;color: #586069;line-height: 23px;">高速下载:</span></div> |
94 | 94 | <div><a style="${download_release_style}" class="btn" href="${url1}" rel="nofollow">${download_url1_name}</a></div> |
95 | 95 | <div><a style="${download_release_style}" class="btn" href="${url2}" rel="nofollow">${download_url2_name}</a></div> |
96 | 96 | <div><a style="${download_release_style}" class="btn" href="${url3}" rel="nofollow">${download_url3_name}</a></div> |
|
100 | 100 | $(this).after(html1); |
101 | 101 | }); |
102 | 102 | // 修改 Source code 样式,使其和加速按钮并列一排 |
103 | | - document.querySelectorAll('.d-block.py-1.py-md-2.Box-body.px-2').forEach(el=>el.className='d-flex py-1 py-md-2 Box-body px-2'); |
| 103 | + document.querySelectorAll('div.d-block.py-1.py-md-2.Box-body.px-2').forEach(el=>el.className='d-flex py-1 py-md-2 Box-body px-2'); |
104 | 104 | }); |
105 | 105 | } |
106 | 106 |
|
|
0 commit comments