Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dark Mode not working #1

Open
MariusSp opened this issue Feb 20, 2023 · 15 comments
Open

Dark Mode not working #1

MariusSp opened this issue Feb 20, 2023 · 15 comments

Comments

@MariusSp
Copy link

The Dark mode is not working for me even though I have selected it in Firefox settings.

Galaxy Tab S8 with Mull.

@artisticfox8
Copy link
Owner

The Dark mode is not working for me even though I have selected it in Firefox settings.

Galaxy Tab S8 with Mull.

Is your system theme set to dark?

@MariusSp
Copy link
Author

Yes

@artisticfox8
Copy link
Owner

Yes

System theme, not Firefox theme

@artisticfox8
Copy link
Owner

The dark mode is just a simple
@media (prefers-color-scheme: dark) in CSS

@artisticfox8
Copy link
Owner

Also, which addons are you running?

@artisticfox8
Copy link
Owner

Dark Reader may sometimes interfere

@MariusSp
Copy link
Author

Yes

System theme, not Firefox theme
Both system and firefox themes are dark.

Running Ublock Origin and DarkReader, although I disabled the latter for the time being.

@artisticfox8
Copy link
Owner

artisticfox8 commented Feb 21, 2023

Well, I implemented the dark mode the simplest possible way, so there may be a bug in the fork of Firefox you're using

@artisticfox8
Copy link
Owner

What Android version are you on?

@MariusSp
Copy link
Author

Latest Android 13 for the Galaxy Tab S8
Mull also latest Version from Fdroid.

@artisticfox8
Copy link
Owner

Latest Android 13 for the Galaxy Tab S8 Mull also latest Version from Fdroid.

I'm also on a Samsung device, but it works for me.
Have you tried using the official Firefox build from Mozilla?

@panbroggi
Copy link

Hi, same issue with same configuration of Mull. Do you think it may be possible to add a dark mode switch in the extension setting?
P.s. thank you for the extension!

@artisticfox8
Copy link
Owner

Hi, same issue with same configuration of Mull. Do you think it may be possible to add a dark mode switch in the extension setting? P.s. thank you for the extension!

I think the issue is caused by an about:config setting in Mull which, aiming to increase privacy, hides the true value of prefers-color-scheme media query to websites. Since the addon is running inside of an iframe, on a website, it is impacted by this too.

The reason why I didn't ship a JS powered dark mode was to avoid flashes of white before settings are received by the tab bar iframe, and the proper color would be set.

So I could implement a dark mode, but if I send settings to a tab from a background script (where they are loaded in RAM), it is still slow enough for the user to notice. So if you have any hack/idea how to retrieve that dark mode setting faster, that would be nice

@artisticfox8
Copy link
Owner

The Manifest V3 session storage API looks promising (as its all in memory, can be done as shared memory, so it should be fast), but then I'd have to rewrite the entire thing to Manifest V3, which would probably add random slowness since background scripts are not allowed to be persistent in MV3, meaning once the background script is forcibly turned off, the user would send an event from the tab bar, which would wake up (start) the background script, which would then execute what's needed. It would basically have to be loaded from the disk, compared to being loaded in memory all the time right now (MV2)

@artisticfox8
Copy link
Owner

Perhaps an interesting quick fix for you is considering Dark Reader. Apart from giving all websites a nice color scheme, it also gives the tab bar a dark mode (even when the tab bar is set to light mode by Android's theme setring.), solving the situation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants