Commit 6a94be77 authored by henry's avatar henry Committed by Pier Angelo Vendrame
Browse files

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

parent d89966e6
Loading
Loading
Loading
Loading
+61 −17
Original line number Diff line number Diff line
@@ -3,8 +3,8 @@
// Show a prompt that a user's system will no longer be supported.
window.addEventListener("load", () => {
  let labelId;
  // Expire date is 2024-10-01 (1st October 2024).
  const isExpired = Date.now() > Date.UTC(2024, 9, 1);
  // ESR 115 EOL pushed to 24th March 2026.
  const isExpired = Date.now() > Date.UTC(2026, 2, 24);

  if (
    AppConstants.platform === "macosx" &&
@@ -15,14 +15,14 @@ window.addEventListener("load", () => {
  ) {
    labelId = isExpired
      ? "dropped-support-notification-macos-version-less-than-10-15-expired"
      : "dropped-support-notification-macos-version-less-than-10-15";
      : "dropped-support-notification-macos-version-less-than-10-15-extended-13-5";
  } 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";
      : "dropped-support-notification-win-os-version-less-than-10-extended-13-5";
  }

  const dismissedPref =
@@ -44,10 +44,54 @@ window.addEventListener("load", () => {
    return;
  }

  const buttons = isExpired
    ? undefined
    : [
  // 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;
  }

  const link = `https://support.torproject.org/${
    locale ? `${locale}/` : ""
  }tbb/tor-browser-and-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(
@@ -55,8 +99,8 @@ window.addEventListener("load", () => {
          AppConstants.BASE_BROWSER_VERSION
        );
      },
        },
      ];
    });
  }

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