diff --git a/toolkit/profile/nsToolkitProfileService.cpp b/toolkit/profile/nsToolkitProfileService.cpp index 4ebdcd3bd873..79c53fc27df0 100644 --- a/toolkit/profile/nsToolkitProfileService.cpp +++ b/toolkit/profile/nsToolkitProfileService.cpp @@ -75,7 +75,7 @@ using namespace mozilla; #define DEV_EDITION_NAME "dev-edition-default" -#define DEFAULT_NAME "default" +#define DEFAULT_NAME "68-edition-default" #define COMPAT_FILE u"compatibility.ini"_ns #define PROFILE_DB_VERSION "2" #define INSTALL_PREFIX "Install" @@ -1218,6 +1218,21 @@ nsresult nsToolkitProfileService::Init() { } } + // Safety net for non‑DevEdition builds: + // If we detected a first run but there is exactly one profile and it was + // classified as "dev-edition default" (due to a name collision), treat it as + // the normal default instead of creating a new profile. + if (!mUseDevEditionProfile && mDevEditionDefault && !mNormalDefault && + nonDevEditionProfiles == 0 && mProfiles.getFirst() == mProfiles.getLast()) { + SetNormalDefault(mDevEditionDefault); + // For non-dedicated profiles, directly avoid first-run. + if (!mUseDedicatedProfile) { + mIsFirstRun = false; + } + // In dedicated-profile mode, keep mIsFirstRun as-is so the adoption path + // in SelectStartupProfile can run with mNormalDefault set. + } + return NS_OK; }