Skip to content

Commit 5b1dc6b

Browse files
committed
调整 白天晚上时间分割线为晚上 6 点
1 parent 49f1ec9 commit 5b1dc6b

1 file changed

Lines changed: 3 additions & 20 deletions

File tree

DarkMode.user.js

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// ==UserScript==
22
// @name 护眼模式
3-
// @version 1.3.0
3+
// @version 1.3.1
44
// @author X.I.U
55
// @description 简单有效的全网通用护眼模式(夜间模式、暗黑模式、深色模式)
66
// @match *://*/*
@@ -329,8 +329,8 @@
329329
style_31 = style_31_firefox
330330
}
331331

332-
// 白天(7点到19点
333-
if (hours > 6 && hours < 19) {
332+
// 白天(7点到18点
333+
if (hours > 6 && hours < 18) {
334334
if (menu_value('menu_runDuringTheDay')) {
335335
style_12 = style_11
336336
style_22 = style_21
@@ -415,23 +415,6 @@
415415
}
416416
});
417417

418-
// 用来解决一些 CSS 加载缓慢的网站,可能会出现没有正确排除的问题,在没有找到更好的办法之前,先这样凑活着用
419-
/*setTimeout(function(){
420-
console.log('[护眼模式] html:', window.getComputedStyle(document.lastElementChild).backgroundColor, 'body:', window.getComputedStyle(document.body).backgroundColor)
421-
if (window.getComputedStyle(document.body).backgroundColor === 'rgb(0, 0, 0)' || getColorValue(document.body) > 0 && getColorValue(document.body) < 898989 || getColorValue(document.lastElementChild) > 0 && getColorValue(document.lastElementChild) < 898989) {
422-
// 如果是黑色 (等于0,0,0) 或深色 (小于 89,89,89),就停用本脚本滤镜
423-
if (menu_value('menu_autoRecognition')) { // 排除自带暗黑模式的网页 (beta)
424-
for (let i=0;i<websiteList.length;i++){ // 这些网站强制启用护眼模式滤镜
425-
if (websiteList[i] === location.host) return
426-
}
427-
if (remove) return
428-
console.log('[护眼模式] 检测到当前网页自带暗黑模式,停用本脚本滤镜...')
429-
if (document.getElementById('XIU2DarkMode')) document.getElementById('XIU2DarkMode').remove();
430-
if (document.getElementById('XIU2DarkMode2')) document.getElementById('XIU2DarkMode2').remove();
431-
}
432-
}
433-
}, 3000);*/
434-
435418
// 解决远景论坛会清理掉前面插入的 CSS 样式的问题
436419
if (location.hostname === 'bbs.pcbeta.com') {
437420
let timer1 = setInterval(function(){

0 commit comments

Comments
 (0)