Skip to content

Commit c12d9ee

Browse files
committed
适配 [与系统同步] 时的深色主题
1 parent 046b80e commit c12d9ee

1 file changed

Lines changed: 15 additions & 6 deletions

File tree

GithubEnhanced-High-Speed-Download.user.js

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// ==UserScript==
22
// @name Github 增强 - 高速下载
3-
// @version 1.5.3
3+
// @version 1.5.4
44
// @author X.I.U
55
// @description 高速下载 Git Clone/SSH、Release、Raw、Code(ZIP) 等文件、项目列表单文件快捷下载 (☁)
66
// @match *://github.com/*
@@ -20,18 +20,27 @@
2020
(function() {
2121
var backColor = '#ffffff';
2222
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') {
2525
backColor = '#272e37';
2626
fontColor = '#768390';
2727
} else {
2828
backColor = '#161a21';
2929
fontColor = '#b2b8bf';
3030
}
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+
}
3140
}
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', '美国'],
3544
var download_url = [
3645
['https://gh.api.99988866.xyz', '美国'],
3746
['https://gh.msx.workers.dev', '美国'],

0 commit comments

Comments
 (0)