Keeps Firefox's built-in New Tab page and randomizes the native wallpaper that Firefox itself renders each time a new tab opens.
This is not a WebExtension. It cannot be installed from AMO or as an .xpi.
It loads privileged browser-context JavaScript through
fx-autoconfig and modifies both
the Firefox application bundle and your profile.
Proof of concept, validated against Firefox 155/156 on macOS. The install.sh
and uninstall.sh helpers are macOS-only; the module itself is not tied to a
platform but has not been tested elsewhere.
- macOS, Firefox 141 or newer with the built-in wallpaper feature (validated against Firefox 155/156)
curlandtar(included with macOS)- fx-autoconfig 0.10 or newer
- An unmodified Firefox installation is not required, but any other autoconfiguration setup must be removed first
- Network access during install to download fx-autoconfig
fx-autoconfig is MPL-2.0 and is downloaded at install time. It is not bundled in this repository.
Firefox's New Tab wallpaper is driven by these profile preferences:
browser.newtabpage.activity-stream.newtabWallpapers.enabled
browser.newtabpage.activity-stream.newtabWallpapers.user.enabled
browser.newtabpage.activity-stream.newtabWallpapers.wallpaper
The wallpaper preference stores a wallpaper record title such as dark-panda,
not an image URL. Firefox resolves that title against its newtab-wallpapers-v2
Remote Settings record list and paints the matching image.
The module:
- Runs at startup, before any window exists, and enables the wallpaper feature
so Firefox's New Tab
WallpaperFeedfetches its record list. - Fetches the public record list and keeps the titles that have images. If the fetch fails, it uses a built-in fallback list.
- Sets
wallpaperto a random title at startup and whenever a tab opens.
Firefox's built-in New Tab page performs the actual rendering.
From this directory:
./install.shThe script resolves the default profile from profiles.ini, downloads
fx-autoconfig, copies its loader into the Firefox app bundle, and installs the
module into <profile>/chrome/JS/. Both scripts source lib.sh, so keep the
files in this repository together.
Override the defaults with environment variables:
FIREFOX_APP="/Applications/Firefox Developer Edition.app" ./install.sh
PROFILE="$HOME/Library/Application Support/Firefox/Profiles/abc.default-release" ./install.sh
FX_AUTOCONFIG_REF="master" ./install.shIf profiles.ini cannot be read (for example, from a sandboxed terminal), pass
the profile explicitly. Open about:profiles in Firefox, copy the Root
Directory of the profile marked as in use, and run:
PROFILE="/path/from/about:profiles" ./install.shFor non-standard Firefox installations, set FIREFOX_PROFILES_DIR to the
directory containing that installation's profiles.ini.
The default FX_AUTOCONFIG_REF is pinned to a specific fx-autoconfig commit.
Set it to master to track the latest loader.
After installing:
- Fully quit Firefox.
- Relaunch Firefox.
- If nothing changes, open
about:supportand click Clear startup-cache, then restart Firefox.
- Copy the contents of fx-autoconfig's
program/directory into/Applications/Firefox.app/Contents/Resources/.config.jsmust end up atContents/Resources/config.js. - Copy
fx-autoconfig/profile/chrome/utils/into<profile>/chrome/utils/. - Copy
chrome/JS/random-newtab-wallpaper.sys.mjsfrom this repository into<profile>/chrome/JS/. - Fully quit Firefox, relaunch, and clear the startup cache from
about:supportif needed.
- Open several new tabs. The built-in search bar, logo, and top sites remain, and the native wallpaper changes.
- Open
about:configand enter the keybrowser.newtabpage.activity-stream.newtabWallpapers.wallpaper. The value should be a different wallpaper title after new tabs. - Module logs use the
[random-newtab-wallpaper]prefix and appear in the Browser Console, not the New Tab page console.
./uninstall.shThis removes the module and the fx-autoconfig loader files that belong to this
installation. It leaves other user scripts and resources in chrome/ alone.
After uninstalling:
- Fully quit Firefox.
- Clear the startup cache from
about:support. - Reset the three wallpaper preferences listed above in
about:config.
- The wallpaper preference is profile-global. Each new tab applies a fresh random wallpaper, but all currently open New Tab pages repaint to that same wallpaper. Distinct simultaneous wallpapers per tab are not possible with Firefox's built-in wallpaper mechanism.
- Firefox updates replace the application bundle and remove the autoconfig
files. Re-run
install.shafter updating Firefox. - Undocumented internals. The preference names and the Remote Settings collection are Firefox internals and can change without notice.
- Offline startup uses the fallback title list. Firefox still needs its own cached wallpaper record list to resolve those titles.
- Retired titles. If a fallback title no longer exists, the page paints nothing until a title from the refreshed live list is applied.
- Manual wallpaper choices are overwritten on the next tab. This is intended for this proof of concept.
- No settings UI, category filtering, or repeat history is provided.
- Private windows do not show the wallpaper. The profile-wide preferences are still set, but the private New Tab page does not paint the random wallpaper.
- Enterprise-locked preferences cannot be changed. The module logs a warning and leaves the page unchanged.
MIT, see LICENSE. fx-autoconfig is downloaded at install time and remains under its own MPL-2.0 license; it is not included in this repository.