From 5b1dc6b0e22f7c72e768f3f52d7dea31381756cd Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Thu, 25 Nov 2021 18:37:19 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=20=E7=99=BD=E5=A4=A9?= =?UTF-8?q?=E6=99=9A=E4=B8=8A=E6=97=B6=E9=97=B4=E5=88=86=E5=89=B2=E7=BA=BF?= =?UTF-8?q?=E4=B8=BA=E6=99=9A=E4=B8=8A=206=20=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DarkMode.user.js | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/DarkMode.user.js b/DarkMode.user.js index 82a1c7a..5c968e1 100644 --- a/DarkMode.user.js +++ b/DarkMode.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 护眼模式 -// @version 1.3.0 +// @version 1.3.1 // @author X.I.U // @description 简单有效的全网通用护眼模式(夜间模式、暗黑模式、深色模式) // @match *://*/* @@ -329,8 +329,8 @@ style_31 = style_31_firefox } - // 白天(7点到19点) - if (hours > 6 && hours < 19) { + // 白天(7点到18点) + if (hours > 6 && hours < 18) { if (menu_value('menu_runDuringTheDay')) { style_12 = style_11 style_22 = style_21 @@ -415,23 +415,6 @@ } }); - // 用来解决一些 CSS 加载缓慢的网站,可能会出现没有正确排除的问题,在没有找到更好的办法之前,先这样凑活着用 - /*setTimeout(function(){ - console.log('[护眼模式] html:', window.getComputedStyle(document.lastElementChild).backgroundColor, 'body:', window.getComputedStyle(document.body).backgroundColor) - 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) { - // 如果是黑色 (等于0,0,0) 或深色 (小于 89,89,89),就停用本脚本滤镜 - if (menu_value('menu_autoRecognition')) { // 排除自带暗黑模式的网页 (beta) - for (let i=0;i