Commit 7e836edd authored by henry's avatar henry
Browse files

fixup! Bug 43125: Extend the 13.5 EOL expiry date for tor-browser.

TB 43168: Update EOL notification logic for final release.

We drop the expiration date. And we update the url.

We also allow the user to permanently dismiss the final notification.
parent 761453a4
Loading
Loading
Loading
Loading
+18 −52
Changes for browser/base/content/droppedSupportNotification.js: 18 added lines, 52 removed lines.
Original line number Diff line number Diff line
@@ -3,8 +3,6 @@
// Show a prompt that a user's system will no longer be supported.
window.addEventListener("load", () => {
  let labelId;
  // ESR 115 EOL pushed to 24th March 2026.
  const isExpired = Date.now() > Date.UTC(2026, 2, 24);

  if (
    AppConstants.platform === "macosx" &&
@@ -13,22 +11,22 @@ window.addEventListener("load", () => {
      "19.0" // MacOS 10.15 begins with Darwin 19.0
    ) < 0
  ) {
    labelId = isExpired
      ? "dropped-support-notification-macos-version-less-than-10-15-expired"
      : "dropped-support-notification-macos-version-less-than-10-15-extended-13-5";
    labelId =
      "dropped-support-notification-macos-version-less-than-10-15-expired";
  } else if (
    AppConstants.platform === "win" &&
    Services.vc.compare(Services.sysinfo.getProperty("version"), "10.0") < 0
  ) {
    labelId = isExpired
      ? "dropped-support-notification-win-os-version-less-than-10-expired"
      : "dropped-support-notification-win-os-version-less-than-10-extended-13-5";
    labelId =
      "dropped-support-notification-win-os-version-less-than-10-expired";
  }

  const dismissedPref =
    "browser.dropped_support_notification_v14.dismiss_version";

  if (!labelId) {
    // User has moved the application to a newer version. They should get an
    // update beyond 13.5.
    // Avoid setting any preferences for supported versions, and clean up any
    // old values if the user ported their profile.
    Services.prefs.clearUserPref(dismissedPref);
@@ -36,7 +34,6 @@ window.addEventListener("load", () => {
  }

  if (
    !isExpired &&
    Services.prefs.getStringPref(dismissedPref, "") ===
    AppConstants.BASE_BROWSER_VERSION
  ) {
@@ -44,54 +41,23 @@ window.addEventListener("load", () => {
    return;
  }

  // Locales that have support pages.
  // Note, these correspond to their app locale names.
  const supportLocales = [
    "en-US",
    "ar",
    "de",
    "es-ES",
    "fa",
    "fr",
    "id",
    "it",
    "ko",
    "pt-BR",
    "ro",
    "ru",
    "sw",
    "tr",
    "uk",
    "vi",
    "zh-CN",
    "zh-TW",
  ];
  // Find the first locale that matches.
  let locale = Services.locale.appLocalesAsBCP47.find(l => {
    return supportLocales.includes(l);
  });
  if (locale === "es-ES") {
    // Support page uses "es". All other locales use the same code in Tor
    // Browser as the support page.
    locale = "es";
  } else if (locale === "en-US") {
    // This is the default.
    locale = undefined;
  let locale = Services.locale.appLocaleAsBCP47;
  if (locale === "ja-JP-macos") {
    // Convert quirk-locale to the locale used for tor project.
    locale = "ja";
  }

  const link = `https://support.torproject.org/${
    locale ? `${locale}/` : ""
  }tbb/tor-browser-and-legacy-os/`;
  // NOTE: The support page only covers a subset of locales. But they should
  // redirect to the default en-US page if the locale is not supported.
  // Locales that have support pages.
  // NOTE: /es-ES/ will redirect to /es/.
  const link = `https://support.torproject.org/${locale}/tor-browser/security/legacy-os/`;

  const buttons = [
    {
      "l10n-id": "notification-learnmore-default-label",
      link,
    },
  ];

  if (!isExpired) {
    buttons.push({
    {
      "l10n-id": "dropped-support-notification-dismiss-button",
      callback: () => {
        Services.prefs.setStringPref(
@@ -99,8 +65,8 @@ window.addEventListener("load", () => {
          AppConstants.BASE_BROWSER_VERSION
        );
      },
    });
  }
    },
  ];

  gNotificationBox.appendNotification(
    "dropped-support-notification",