Cimbali / toggle-dark-mode

A webextension to toggle the content’s color scheme between preferring light or dark, or inheriting
Do What The F*ck You Want To Public License
21 stars 0 forks source link

What's the browser default? #1

Closed mystiquewolf closed 2 years ago

mystiquewolf commented 2 years ago

I mean the way Firefox behaves without the addon? I guess it's to follow the system default, am I right? Not sure if the addon restores it upon uninstall, didn't bother to check, but decided to open this issue just in any case.

Cimbali commented 2 years ago

I think the default is to inherit from the browser theme, which in turn may or may not inherit from the system theme.

Since this add-on is onl toggling a system preference without doing anything else, uninstalling does no changes to the preference, which means leaving it in its last state.

Determining which correct default to reset after uninstalling is not trivial I guess, maybe the previous value could be stored somewher? .

mystiquewolf commented 2 years ago

I think the value that this setting is set to upon a clear installation of Firefox / clean profile. I don't know if by default Firefox looks at the browser theme or at the device theme.

Cimbali commented 2 years ago

It seems currently the default is to inherit from the system, not the browser.

mystiquewolf commented 2 years ago

FWIW i found THIS... Seems legit.

Cimbali commented 2 years ago

Thanks! It seems from the BrowsetSetting.set() docs that BrowserSetting.clear() is called upon uninstall, as we the add-on releases control of the preference.