rugk/website-dark-mode-switcher

implement optional syncing!

Opened this issue · 1 comments

todo commented

// TODO: implement optional syncing!
// const shouldBeSynced = await AddonSettings.get("shouldBeSynced");
// if (shouldBeSynced) {
// const currentBrowserSetting = (await browser.browserSettings.overrideContentColorScheme.get({})).value;
// const syncedSetting = await AddonSettings.get("prefersColorSchemeOverride");


This issue was generated by todo based on a TODO comment in f73db32 when #41 was merged. cc @rugk.
rugk commented

Background

I may want to disable syncing, because other connected devices may be used in a very different setting (place/location/time…) and there I need different settings (like "always dark" etc.)

Proposed solution

A setting ("Synchronize across devices", itself needs to be saved locally?, boolean/checkbox) that you can enable to enable synchronization.
By default: Disabled, I guess. (Or enabled to ease migration from the current settings. 🙃)

The problem is our libs like AutomaticSettings never considered this use-case, so they only offer sync by-default, so either they
This makes it a little more complicated.

Alternatives

  • Not offer this and always sync, as it is currently done?
  • Disable syncing altogether – that would be quite easy and maybe satisfy totally the use case. After all, who needs syncing anyway for such an add-on. Do you? (Comment if you do, please.) After all, devices differ that much that it is hardly useful to have all settings synchronized. Also, these are really not a lot settings, so they are manageable to set on each new device or so.

Additional context