Commit 728cc570 authored by henry's avatar henry Committed by brizental
Browse files

fixup! TB 7494: Create local home page for TBB.

TB 43929: Update about:tor override page logic for ESR 140.

Unlike ESR 128, we do not try and move the startPage logic to earlier in
the method since it would complicate the patch and upstream's logic.
Instead, we delay out duplicate about:tor logic until the end of the
method.
parent f01b6c3b
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
@@ -775,6 +775,7 @@ nsBrowserContentHandler.prototype = {
    var overridePage = "";
    var additionalPage = "";
    var willRestoreSession = false;
    let openAboutTor = false;
    try {
      // Read the old value of homepage_override.mstone before
      // needHomepageOverride updates it, so that we can later add it to the
@@ -970,6 +971,19 @@ nsBrowserContentHandler.prototype = {
              "%OLD_BASE_BROWSER_VERSION%",
              old_forkVersion
            );
            if (AppConstants.BASE_BROWSER_UPDATE) {
              // Tor Browser: Instead of opening the post-update "override page"
              // directly, we ensure that about:tor will be opened, which should
              // notify the user that their browser was updated.
              // NOTE: We ignore any existing overridePage value, which can come
              // from the openURL attribute within the updates.xml file.
              Services.prefs.setBoolPref(
                "torbrowser.post_update.shouldNotify",
                true
              );
              openAboutTor = true;
              overridePage = "about:tor";
            }
            break;
          }
          case OVERRIDE_NEW_BUILD_ID: {
@@ -1069,6 +1083,16 @@ nsBrowserContentHandler.prototype = {
      startPage = "";
    }

    // If the user's homepage is about:tor, we do not want to open it twice with
    // the override.
    if (
      openAboutTor &&
      startPage === "about:tor" &&
      overridePage?.split("|").includes("about:tor")
    ) {
      startPage = "";
    }

    // Only show the startPage if we're not restoring an update session and are
    // not set to skip the start page on this profile
    if (overridePage && startPage && !willRestoreSession && !skipStartPage) {