Greasy Fork is available in English.

Reddit Auto Dark Mode

Change Reddit's theme based on your system theme

< Відгуки до Reddit Auto Dark Mode

Відгук: OK - script works, but has bugs

§
Опубліковано: 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)...

§
Опубліковано: 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.

YukiteruАвтор
§
Опубліковано: 13.09.2024

Thanks, fixed using your code

Опублікувати відповідь

Sign in to post a reply.