Commit 9cf0d4c8 authored by Pier Angelo Vendrame's avatar Pier Angelo Vendrame 🎃
Browse files

fixup! Bug 9173: Change the default Firefox profile directory to be relative.

Force `GenerateAppUserModelID` to use the profile directory in portable
mode.
parent 551297b7
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -209,6 +209,19 @@ bool WinTaskbar::GenerateAppUserModelID(nsAString& aAppUserModelId,
  // If marked as such in prefs, use a hash of the profile path for the id
  // instead of the install path hash setup by the installer.
  bool useProfile = Preferences::GetBool("taskbar.grouping.useprofile", false);

  {
    // For portable mode, force the AUMID to be based on the profile directory
    // instead of reading it from the registry.
    bool isPortable = true;
    // Do not even check if taskbar.grouping.useprofile is already true.
    if (!useProfile &&
        NS_SUCCEEDED(gDirServiceProvider->GetIsPortableMode(&isPortable)) &&
        isPortable) {
      useProfile = true;
    }
  }

  if (useProfile) {
    nsCOMPtr<nsIFile> profileDir;
    NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR,