Open Bug 1682168 Opened 4 years ago Updated 4 years ago

matchMedia event listener won't fire on theme change

Categories

(Thunderbird :: Add-Ons: Extensions API, defect)

Thunderbird 85
defect

Tracking

(Not tracked)

UNCONFIRMED

People

(Reporter: juraj.masiar, Unassigned)

Details

Attachments

(2 files)

7.09 KB, application/x-zip-compressed
Details
8.33 KB, application/x-zip-compressed
Details
Attached file src.zip

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0

Steps to reproduce:

  1. make sure your Thunderbird is using Default theme (the one that changes to dark/light based on the OS setting)
  2. load extension
  3. click "Inspect" button to see the background script
  4. open Windows "Color settings" and change "Choose your color" to Custom and "Choose your default app mode" to Dark / Light (switch back and forth)

Actual results:

Theme correctly changes in Thunderbird.
If you execute window.matchMedia('(prefers-color-scheme: dark)').matches you get the correct True / False value.
BUT the event won't fire when the change happens!

Expected results:

The event should fire when OS changes the theme.

Note that the event will fire if you manually change your Thunderbird theme.

Component: Untriaged → Add-Ons: Extensions API
Attached file matchMedia.zip

I can confirm, it does not work in a background page in Thunderbird, while it does work in a background page in Firefox.

It works in normal WebExtension pages for both.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: