WesselKroos / youtube-ambilight

This browser extension adds ambient light to YouTube videos
MIT License
78 stars 8 forks source link

(option to) use dark reader to detect "default" Appearance (theme) setting instead of youtube's site default #218

Closed kaem-e closed 2 months ago

kaem-e commented 4 months ago

I use dark reader in conjunction with auto dark mode on Youtube for dark mode instead of Youtube's own appearance setting, leaving the Youtube default theme to light, as dark reader allows live reload without refreshing the page.

Regardless, it seems like Ambilight uses the Youtube's site theme setting to determine whether it should treat the site as being in light or dark mode when you have the Default option set in the Appearance (theme) setting under general. However this means that when I have my system in dark mode, it will still treat webpages as being light even though dark readers already made the webpage elements dark. scrrenshot of Youtube with light mode styling from Ambilight, while UI elements are dark via dark reader

An option to toggle between detecting dark theme based off of the dark reader setting instead of the site theme when the Default option set in the Appearance (theme) setting would be ideal. even if its accessed via the "advanced toggle" and is disabled by default would be fine as it would mean people who have a setup such as mine would have a solution, while everyone else would have Ambilight work as normal, as it does now.

Alternatively, it would be nice if Ambilight simply detected the system theme but I don't know how complicated that would be to implement therefore its not the primary solution I thought of

WesselKroos commented 4 months ago

Thanks for your suggestion. Looking at the possible solutions I think using the system theme might be useful for more users. I'm already tracking and reading the system theme with if(matchMedia('(prefers-color-scheme: dark)').matches) return THEME_DARK so I expect that shouldn't take to much work. I'll add a 4th appearance option that will use the system's theme.

kaem-e commented 4 months ago

Thank you! that'd be great

WesselKroos commented 4 months ago

While reading your question again I come to the conclusion that you're actually asking for another type of option that leaves the theme of the page as it is. That option should then never modify the theme of the page, so that you can manage the page's theme with another extension.

So I think I'll eventually opt for the option to fix the "Default" behaviour, so that it will never change the theme of the page.

And I expect that an option that changes the theme based on the system theme won't be used often since it does not track system theme changes while the ambient light is disabled/not on a video page.

WesselKroos commented 2 months ago

@kaem-e It took a while, but the new theming behavior is now available on all browsers

kaem-e commented 2 months ago

thank you so much !!!!!