Reddit Auto Dark Mode

Change Reddit's theme based on your system theme

< 脚本Reddit Auto Dark Mode的反馈

评价:一般 - 脚本能用,但还有一些问题

§
发表于:2024-06-13

If you're a moderator of any subreddit, the script (as of version 1.0) will end toggling the Mod Mode switch instead of the Dark Mode switch. To fix that, change line 13 from return document.querySelector('faceplate-switch-input'); to return document.querySelector('#darkmode-list-item > div > span.flex.items-center.shrink-0 > span > faceplate-switch-input');

Additionally, if you have issues with the switch quickly going back and forth between dark/light mode (ending mismatched with the browser setting), try increasing the timeout on line 25 (e.g. change it to setTimeout(() => toggleTheme(darkMedia.matches), 500) -- 500 seems to always work, while the default 300 from the script it normally triggers this bug)...

§
发表于:2024-08-20

If you're a moderator of any subreddit, the script (as of version 1.0) will end toggling the Mod Mode switch instead of the Dark Mode switch. To fix that, change line 13 from return document.querySelector('faceplate-switch-input'); to return document.querySelector('#darkmode-list-item > div > span.flex.items-center.shrink-0 > span > faceplate-switch-input');

Additionally, if you have issues with the switch quickly going back and forth between dark/light mode (ending mismatched with the browser setting), try increasing the timeout on line 25 (e.g. change it to setTimeout(() => toggleTheme(darkMedia.matches), 500) -- 500 seems to always work, while the default 300 from the script it normally triggers this bug)...

The mod switch fix works great. The timeout change doesn't work for me on Firefox, dark mode flashes on briefly before returning to light mode. 300 still works fine strangely.

Yukiteru作者
§
发表于:2024-09-13

Thanks, fixed using your code

发表回复

登录以发表回复。