Open Bug 1928902 Opened 4 months ago Updated 4 months ago

Ignore static theme updates if dynamic theme had been applied

Categories

(WebExtensions :: Themes, enhancement, P3)

enhancement

Tracking

(Not tracked)

People

(Reporter: robwu, Unassigned)

References

Details

In bug 1928082, the default theme was re-installed at every startup due to a bug. Because static themes are applied when they are started, the user-perceived bug was the loss of dynamic themes (from theme.update(), e.g. from the Firefox Color extension). The impact of the other bug was reduced by avoiding re-installation of themes at every startup, but the root cause for the observed issue is still present: dynamic themes are lost when a static theme is updated, even if that static theme was supposed to be overridden by the dynamic theme.

We should prevent static theme updates from overriding theme.update() calls. If theme.update() has been called, we should only permit modification of the theme if:

  • theme.update() is called again by the same or another extension. (already happening)
  • A static theme is installed. (already happening)

The global theme should not be applied in the following situations:

  • A static theme was updated. (this is new behavior)

To implement this, we could restrict the theme loading in onManifestEntry, to only proceed if any of the following is true:

Concretely, not applying the theme means to not initialize the Theme instance (returning early from onManifestEntry). This fixes the issue because the Theme constructor calls load(), which is responsible for the activation of the theme.

Severity: -- → N/A
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.