Newtab minor console error related to wallpaper v1 removal
Categories
(Firefox :: New Tab Page, defect)
Tracking
()
People
(Reporter: thecount, Assigned: thecount)
References
Details
Attachments
(2 files)
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
phab-bot
:
approval-mozilla-beta+
|
Details | Review |
Seeing this error "JavaScript error: resource://newtab/data/content/activity-stream.bundle.js, line 13454: TypeError: undefined has no properties"
Looks like this is due to https://searchfox.org/mozilla-central/source/browser/extensions/newtab/content-src/components/Base/Base.jsx#435-436
// Grab the contrast of the currently displayed wallpaper.
const { theme } =
this.state.colorMode === "light" ? lightWallpaper : darkWallpaper;
Essentially if the user has no wallpaper set, lightWallpaper/darkWallpaper are undefined.
let lightWallpaper;
let darkWallpaper;
Preciously they would be empty strings in this case, which is also not correct, and probably why we didn't notice this error.
The console error itself is also harmless, currently, because the rest of the code in this function isn't necessary for the case of no wallpaper being set, but we should clear it up anyway.
We should fix it with something like this:
let lightWallpaper = {};
let darkWallpaper = {};
Assignee | ||
Comment 1•17 days ago
|
||
Comment 4•15 days ago
|
||
Original Revision: https://phabricator.services.mozilla.com/D240290
Updated•15 days ago
|
Comment 5•15 days ago
|
||
beta Uplift Approval Request
- User impact if declined: Users will see a console error on New Tab page
- Code covered by automated testing: yes
- Fix verified in Nightly: no
- Needs manual QE test: yes
- Steps to reproduce for manual QE testing: Please see the Bugzilla ticket for steps to reproduce
- Risk associated with taking this patch: Low
- Explanation of risk level: This patch assigns a default value to a variable in JS to remove a console error.
- String changes made/needed: None
- Is Android affected?: no
Updated•15 days ago
|
Updated•15 days ago
|
Updated•15 days ago
|
Comment 7•15 days ago
|
||
I have verified that this issue is no longer reproducible using the latest Firefox Nightly 138.0a1 - Build ID: 20250305205032 and Firefox Beta 137.0b3 - Build ID: 20250306083404 (downloaded from treeherder) installed on Windows 10 x64, macOS 15.3.1, and Ubuntu 24.04. I can confirm that after following the steps from here the JavaScript error: resource://newtab/data/content/activity-stream.bundle.js, line 13454: TypeError: undefined has no properties
error is no longer displayed in the Browser Console.
Description
•