[tor-commits] [Git][tpo/applications/tor-browser][tor-browser-115.11.0esr-13.5-1] 2 commits: fixup! Base Browser strings

richard (@richard) git at gitlab.torproject.org
Thu May 16 12:08:39 UTC 2024



richard pushed to branch tor-browser-115.11.0esr-13.5-1 at The Tor Project / Applications / Tor Browser


Commits:
900fb923 by Henry Wilkes at 2024-05-16T12:56:28+01:00
fixup! Base Browser strings

Bug 42347: Add a notification for dropped OS version support.

- - - - -
4a1e3ba3 by Henry Wilkes at 2024-05-16T12:56:28+01:00
Bug 42347: Add a notification for dropped OS version support.

- - - - -


4 changed files:

- browser/base/content/browser.xhtml
- + browser/base/content/droppedSupportNotification.js
- browser/base/jar.mn
- toolkit/locales/en-US/toolkit/global/base-browser.ftl


Changes:

=====================================
browser/base/content/browser.xhtml
=====================================
@@ -132,6 +132,7 @@
   Services.scriptloader.loadSubScript("chrome://browser/content/search/autocomplete-popup.js", this);
   Services.scriptloader.loadSubScript("chrome://browser/content/search/searchbar.js", this);
   Services.scriptloader.loadSubScript("chrome://browser/content/languageNotification.js", this);
+  Services.scriptloader.loadSubScript("chrome://browser/content/droppedSupportNotification.js", this);
 
   window.onload = gBrowserInit.onLoad.bind(gBrowserInit);
   window.onunload = gBrowserInit.onUnload.bind(gBrowserInit);


=====================================
browser/base/content/droppedSupportNotification.js
=====================================
@@ -0,0 +1,69 @@
+"use strict";
+
+// 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);
+
+  if (
+    AppConstants.platform === "macosx" &&
+    Services.vc.compare(
+      Services.sysinfo.getProperty("version"),
+      "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";
+  } 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";
+  }
+
+  const dismissedPref =
+    "browser.dropped_support_notification_v14.dismiss_version";
+
+  if (!labelId) {
+    // Avoid setting any preferences for supported versions, and clean up any
+    // old values if the user ported their profile.
+    Services.prefs.clearUserPref(dismissedPref);
+    return;
+  }
+
+  if (
+    !isExpired &&
+    Services.prefs.getStringPref(dismissedPref, "") ===
+      AppConstants.BASE_BROWSER_VERSION
+  ) {
+    // Already dismissed since the last update.
+    return;
+  }
+
+  const buttons = isExpired
+    ? undefined
+    : [
+        {
+          "l10n-id": "dropped-support-notification-dismiss-button",
+          callback: () => {
+            Services.prefs.setStringPref(
+              dismissedPref,
+              AppConstants.BASE_BROWSER_VERSION
+            );
+          },
+        },
+      ];
+
+  gNotificationBox.appendNotification(
+    "dropped-support-notification",
+    {
+      label: { "l10n-id": labelId },
+      priority: gNotificationBox.PRIORITY_WARNING_HIGH,
+    },
+    buttons
+  );
+});


=====================================
browser/base/jar.mn
=====================================
@@ -111,4 +111,5 @@ browser.jar:
         content/browser/spotlight.js                  (content/spotlight.js)
 *       content/browser/default-bookmarks.html        (content/default-bookmarks.html)
 
+        content/browser/droppedSupportNotification.js (content/droppedSupportNotification.js)
         content/browser/languageNotification.js       (content/languageNotification.js)


=====================================
toolkit/locales/en-US/toolkit/global/base-browser.ftl
=====================================
@@ -166,3 +166,21 @@ security-level-summary-custom = Your custom browser preferences have resulted in
 # Button to undo custom changes to the security level and place the user in one of the standard security levels.
 # Shown in the security level panel and settings.
 security-level-restore-defaults-button = Restore defaults
+
+## Notification for dropped operating system support.
+
+# "{ -brand-short-name }" will be replaced with the localized name of the browser, e.g. "Tor Browser".
+# "14.0" refers to the browser versions number: Tor Browser 14.0.
+# "macOS" is a brand name, and 10.15 is the macOS version number.
+dropped-support-notification-macos-version-less-than-10-15 = The next major version of { -brand-short-name } (14.0) will no longer support this version of macOS. Please upgrade to macOS 10.15 or later by October 1st 2024 to continue receiving important security updates.
+# "{ -brand-short-name }" will be replaced with the localized name of the browser, e.g. "Tor Browser".
+# "macOS" is a brand name, and 10.15 is the macOS version number.
+dropped-support-notification-macos-version-less-than-10-15-expired = { -brand-short-name } no longer supports this version of macOS. Please upgrade to macOS 10.15 or later to continue receiving important security updates.
+# "{ -brand-short-name }" will be replaced with the localized name of the browser, e.g. "Tor Browser".
+# "14.0" refers to the browser versions number: Tor Browser 14.0.
+# "Windows" is a brand name, and "Windows 10" is the version.
+dropped-support-notification-win-os-version-less-than-10 = The next major version of { -brand-short-name } (14.0) will no longer support this version of Windows. Please upgrade to Windows 10 or later by October 1st 2024 to continue receiving important security updates.
+# "{ -brand-short-name }" will be replaced with the localized name of the browser, e.g. "Tor Browser".
+# "Windows" is a brand name, and "Windows 10" is the version.
+dropped-support-notification-win-os-version-less-than-10-expired = { -brand-short-name } no longer supports this version of Windows. Please upgrade to Windows 10 or later to continue receiving important security updates.
+dropped-support-notification-dismiss-button = Got it



View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/c67ac157316b459129bf2fe7da6753d860b80cf6...4a1e3ba31a7f4a5c8aaa854d5d379cc027e26210

-- 
This project does not include diff previews in email notifications.
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/c67ac157316b459129bf2fe7da6753d860b80cf6...4a1e3ba31a7f4a5c8aaa854d5d379cc027e26210
You're receiving this email because of your account on gitlab.torproject.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.torproject.org/pipermail/tor-commits/attachments/20240516/445e0592/attachment-0001.htm>


More information about the tor-commits mailing list