Closed Bug 1938470 Opened 1 year ago Closed 1 year ago

browser.theme.getCurrent() returns null in Firefox Nightly

Categories

(WebExtensions :: Themes, defect)

Firefox 135
defect

Tracking

(firefox133 affected, firefox134 affected, firefox135 affected)

RESOLVED DUPLICATE of bug 1435216
Tracking Status
firefox133 --- affected
firefox134 --- affected
firefox135 --- affected

People

(Reporter: nopeac+github, Unassigned)

Details

Attachments

(3 files)

Attached image log.png

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

Steps to reproduce:

Run the following code snippet:

const theme = await browser.theme.getCurrent();
console.log('theme', theme);
const userAgent = navigator.userAgent.toLowerCase();
console.log('userAgent', userAgent);

Actual results:

The theme variable returned null, indicating that the current theme could not be retrieved.

Expected results:

The theme variable should return an object representing the current theme, including properties such as colors, images, and properties.

The Bugbug bot thinks this bug should belong to the 'Firefox::Theme' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Theme
Component: Theme → Themes
Product: Firefox → WebExtensions

Hello,

I reproduced the issue on the latest Nightly (135.0a1/20241222211804), Beta (134.0b10/20241213091550) and Release (133.0.3/20241209150345) under Windows 10 and Ubuntu 24.04 LTS.

However, the issue only occurs when the default system theme is enabled. When a different theme is enabled, say the Dark Theme, the code snippet will return an object with proprieties as expected.

See attached screenshots for more details.

Status: UNCONFIRMED → NEW
Ever confirmed: true
Attached image dark_theme.png
Status: NEW → RESOLVED
Closed: 1 year ago
Duplicate of bug: 1435216
Resolution: --- → DUPLICATE

It's not really uplifting to see your ticket marked as duplicated in favor of another one that's been open for over 7 years.

I understand that a simple fix is to set the theme to either dark or light, but I've also enabled the Windows' Mica effect flag (widget.windows.mica), which requires the theme to be set to system default in order to work at all.

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

Attachment

General

Creator:
Created:
Updated:
Size: