Reddit Auto Dark Mode

Change Reddit's theme based on your system theme

< Părere la script-ul Reddit Auto Dark Mode

Recenzie: OK - script works, but has bugs

§
Postat în: 13-06-2024

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)...

§
Postat în: 20-08-2024

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.

YukiteruAutor
§
Postat în: 13-09-2024

Thanks, fixed using your code

Postează un raspuns

Autentifică-te pentru a posta un răspuns.