tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit ca8b610fcb97a0dfec685afd9999a9b9979f0199
parent 0f91735b3bd960f7bb9b720cc75a4bd99bf661ca
Author: scottdowne <sdowne@mozilla.com>
Date:   Mon, 20 Oct 2025 20:03:05 +0000

Bug 1950883 - Newtab fallback to remote settings attachment url if network is down r=ini

Differential Revision: https://phabricator.services.mozilla.com/D269132

Diffstat:
Mbrowser/extensions/newtab/lib/Wallpapers/WallpaperFeed.sys.mjs | 13++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/browser/extensions/newtab/lib/Wallpapers/WallpaperFeed.sys.mjs b/browser/extensions/newtab/lib/Wallpapers/WallpaperFeed.sys.mjs @@ -31,6 +31,9 @@ const PREF_WALLPAPERS_CUSTOM_WALLPAPER_UUID = const PREF_SELECTED_WALLPAPER = "browser.newtabpage.activity-stream.newtabWallpapers.wallpaper"; +const RS_FALLBACK_BASE_URL = + "https://firefox-settings-attachments.cdn.mozilla.net/"; + export class WallpaperFeed { #customBackgroundObjectURL = null; @@ -155,7 +158,15 @@ export class WallpaperFeed { PREF_WALLPAPERS_CUSTOM_WALLPAPER_ENABLED ); - const baseAttachmentURL = await lazy.Utils.baseAttachmentsURL(); + let baseAttachmentURL = RS_FALLBACK_BASE_URL; + try { + baseAttachmentURL = await lazy.Utils.baseAttachmentsURL(); + } catch (error) { + console.error( + `Error fetching remote settings base url from CDN. Falling back to ${RS_FALLBACK_BASE_URL}`, + error + ); + } const wallpapers = [ ...records.map(record => {