From 3e66afec8855d6f0d933c85fd7c3dc58a2a8a4d3 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sun, 6 Mar 2022 11:01:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E7=9F=A5=E4=B9=8E?= =?UTF-8?q?=E9=83=A8=E5=88=86=E7=BD=91=E9=A1=B5=E6=B2=A1=E6=9C=89=E6=9A=97?= =?UTF-8?q?=E9=BB=91=E6=A8=A1=E5=BC=8F=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Beautification.user.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Zhihu-Beautification.user.js b/Zhihu-Beautification.user.js index 3cbe99e..b6424f0 100644 --- a/Zhihu-Beautification.user.js +++ b/Zhihu-Beautification.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 知乎美化 -// @version 1.4.7 +// @version 1.4.8 // @author X.I.U // @description 宽屏显示、暗黑模式(4种)、暗黑模式跟随浏览器、屏蔽首页活动广告、隐藏文章开头大图、调整图片最大高度、向下翻时自动隐藏顶栏 // @match *://www.zhihu.com/* @@ -383,6 +383,13 @@ html {filter: brightness(65%) sepia(30%) !important; background-image: url();} // 如果开启了 [暗黑模式] if (menu_value('menu_darkMode')) { + // firefox 浏览器 + if (navigator.userAgent.toLowerCase().indexOf('firefox') > -1) { + style_darkMode_2 = style_darkMode_2_firefox + style_darkMode_3 = style_darkMode_3_firefox + style_darkMode_4 = style_darkMode_4_firefox + } + // 如果开启了 [暗黑模式跟随浏览器] 且 当前浏览器是暗黑模式 if (menu_value('menu_darkModeAuto') && !window.matchMedia('(prefers-color-scheme: dark)').matches) { // 如果是暗黑模式,则需要改为白天模式 @@ -405,11 +412,6 @@ html {filter: brightness(65%) sepia(30%) !important; background-image: url();} if (getTheme() === 'dark') { setTheme('light'); } - if (navigator.userAgent.toLowerCase().indexOf('firefox') > -1) { - style_darkMode_2 = style_darkMode_2_firefox - style_darkMode_3 = style_darkMode_3_firefox - style_darkMode_4 = style_darkMode_4_firefox - } } switch(menu_value('menu_darkModeType')) { case 1: