|
1 | 1 | // ==UserScript== |
2 | 2 | // @name Github 增强 - 高速下载 |
3 | | -// @version 1.5.3 |
| 3 | +// @version 1.5.4 |
4 | 4 | // @author X.I.U |
5 | 5 | // @description 高速下载 Git Clone/SSH、Release、Raw、Code(ZIP) 等文件、项目列表单文件快捷下载 (☁) |
6 | 6 | // @match *://github.com/* |
|
20 | 20 | (function() { |
21 | 21 | var backColor = '#ffffff'; |
22 | 22 | var fontColor = '#888888'; |
23 | | - if (document.getElementsByTagName('html')[0].getAttribute('data-color-mode') == 'dark') { // 黑暗模式判断 |
24 | | - if (document.getElementsByTagName('html')[0].getAttribute('data-dark-theme') == 'dark_dimmed') { |
| 23 | + if (document.getElementsByTagName('html')[0].getAttribute('data-color-mode') === 'dark') { // 黑暗模式判断 |
| 24 | + if (document.getElementsByTagName('html')[0].getAttribute('data-dark-theme') === 'dark_dimmed') { |
25 | 25 | backColor = '#272e37'; |
26 | 26 | fontColor = '#768390'; |
27 | 27 | } else { |
28 | 28 | backColor = '#161a21'; |
29 | 29 | fontColor = '#b2b8bf'; |
30 | 30 | } |
| 31 | + } else if (document.getElementsByTagName('html')[0].getAttribute('data-color-mode') === 'auto') { |
| 32 | + console.log(window.getComputedStyle(document.body).backgroundColor) |
| 33 | + if (window.getComputedStyle(document.body).backgroundColor === 'rgb(34, 39, 46)') { |
| 34 | + backColor = '#272e37'; |
| 35 | + fontColor = '#768390'; |
| 36 | + } else if (window.getComputedStyle(document.body).backgroundColor === 'rgb(13, 17, 23)') { |
| 37 | + backColor = '#161a21'; |
| 38 | + fontColor = '#b2b8bf'; |
| 39 | + } |
31 | 40 | } |
32 | | -//['https://gh.66ccff.work', '美国'], |
33 | | -//['https://github.91chifun.workers.dev', '美国'], |
34 | | -//['https://github.rc1844.workers.dev', '美国'], |
| 41 | + //['https://gh.66ccff.work', '美国'], |
| 42 | + //['https://github.91chifun.workers.dev', '美国'], |
| 43 | + //['https://github.rc1844.workers.dev', '美国'], |
35 | 44 | var download_url = [ |
36 | 45 | ['https://gh.api.99988866.xyz', '美国'], |
37 | 46 | ['https://gh.msx.workers.dev', '美国'], |
|
0 commit comments