From 65597fd6b5a3ce839eda191ce27e06f60d653ce4 Mon Sep 17 00:00:00 2001 From: "mr. m" <91018726+mr-cheffy@users.noreply.github.com> Date: Sat, 28 Mar 2026 08:02:05 +0100 Subject: [PATCH] no-bug: Don't run welcome screen on headless mode (gh-12959) --- src/zen/common/modules/ZenStartup.mjs | 9 ++++- src/zen/common/modules/ZenUpdates.mjs | 55 ++++++++++++++------------- 2 files changed, 35 insertions(+), 29 deletions(-) diff --git a/src/zen/common/modules/ZenStartup.mjs b/src/zen/common/modules/ZenStartup.mjs index 31c339d21..e9c7fa1c6 100644 --- a/src/zen/common/modules/ZenStartup.mjs +++ b/src/zen/common/modules/ZenStartup.mjs @@ -159,8 +159,13 @@ class ZenStartup { } #checkForWelcomePage() { - if (!Services.prefs.getBoolPref("zen.welcome-screen.seen", false)) { - Services.prefs.setBoolPref("zen.welcome-screen.seen", true); + const kWelcomeScreenSeenPref = "zen.welcome-screen.seen"; + if (Services.env.get("MOZ_HEADLESS")) { + Services.prefs.setBoolPref(kWelcomeScreenSeenPref, true); + return; + } + if (!Services.prefs.getBoolPref(kWelcomeScreenSeenPref, false)) { + Services.prefs.setBoolPref(kWelcomeScreenSeenPref, true); Services.prefs.setStringPref( "zen.updates.last-build-id", Services.appinfo.appBuildID diff --git a/src/zen/common/modules/ZenUpdates.mjs b/src/zen/common/modules/ZenUpdates.mjs index 867bbd53f..76c08aa2a 100644 --- a/src/zen/common/modules/ZenUpdates.mjs +++ b/src/zen/common/modules/ZenUpdates.mjs @@ -13,35 +13,36 @@ export default function checkForZenUpdates() { const lastVersion = Services.prefs.getStringPref(ZEN_UPDATE_PREF, ""); Services.prefs.setStringPref(ZEN_UPDATE_PREF, version); if ( - version !== lastVersion && - !gZenUIManager.testingEnabled && - Services.prefs.getBoolPref(ZEN_UPDATE_SHOW, true) + version === lastVersion || + gZenUIManager.testingEnabled || + !Services.prefs.getBoolPref(ZEN_UPDATE_SHOW, true) ) { - const updateUrl = Services.prefs.getStringPref( - "app.releaseNotesURL.prompt", - "" - ); - createSidebarNotification({ - headingL10nId: "zen-sidebar-notification-updated-heading", - links: [ - { - url: Services.urlFormatter.formatURL( - updateUrl.replace("%VERSION%", version) - ), - l10nId: "zen-sidebar-notification-updated", - special: true, - icon: "chrome://browser/skin/zen-icons/heart-circle-fill.svg", - }, - { - action: () => { - Services.obs.notifyObservers(window, "restart-in-safe-mode"); - }, - l10nId: "zen-sidebar-notification-restart-safe-mode", - icon: "chrome://browser/skin/zen-icons/security-broken.svg", - }, - ], - }); + return; } + const updateUrl = Services.prefs.getStringPref( + "app.releaseNotesURL.prompt", + "" + ); + createSidebarNotification({ + headingL10nId: "zen-sidebar-notification-updated-heading", + links: [ + { + url: Services.urlFormatter.formatURL( + updateUrl.replace("%VERSION%", version) + ), + l10nId: "zen-sidebar-notification-updated", + special: true, + icon: "chrome://browser/skin/zen-icons/heart-circle-fill.svg", + }, + { + action: () => { + Services.obs.notifyObservers(window, "restart-in-safe-mode"); + }, + l10nId: "zen-sidebar-notification-restart-safe-mode", + icon: "chrome://browser/skin/zen-icons/security-broken.svg", + }, + ], + }); } export async function createWindowUpdateAnimation() {