browser.theme.getCurrent() returns null in Firefox Nightly
Categories
(WebExtensions :: Themes, defect)
Tracking
(firefox133 affected, firefox134 affected, firefox135 affected)
People
(Reporter: nopeac+github, Unassigned)
Details
Attachments
(3 files)
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.
Comment 1•1 year ago
|
||
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.
Updated•1 year ago
|
Comment 2•1 year ago
|
||
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.
Comment 3•1 year ago
|
||
Comment 4•1 year ago
|
||
Updated•1 year ago
|
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.
Description
•