[tbb-commits] [Git][tpo/applications/tor-browser][base-browser-115.11.0esr-13.5-1] 3 commits: fixup! Bug 42562: Normalized the Accepted Languages on Android.

Pier Angelo Vendrame (@pierov) git at gitlab.torproject.org
Mon May 27 08:08:50 UTC 2024



Pier Angelo Vendrame pushed to branch base-browser-115.11.0esr-13.5-1 at The Tor Project / Applications / Tor Browser


Commits:
00a60291 by Pier Angelo Vendrame at 2024-05-27T10:08:37+02:00
fixup! Bug 42562: Normalized the Accepted Languages on Android.

Bug 42582: Use toLanguageTag() instead of toString()

- - - - -
623ab54b by Henry Wilkes at 2024-05-27T10:08:39+02:00
fixup! Base Browser strings

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

- - - - -
68c9e866 by Henry Wilkes at 2024-05-27T10:08:39+02:00
Bug 42347: Add a notification for dropped OS version support.

- - - - -


5 changed files:

- browser/base/content/browser.xhtml
- + browser/base/content/droppedSupportNotification.js
- browser/base/jar.mn
- mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoRuntimeSettings.java
- toolkit/locales/en-US/toolkit/global/base-browser.ftl


Changes:

=====================================
browser/base/content/browser.xhtml
=====================================
@@ -123,6 +123,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
=====================================
@@ -105,4 +105,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)


=====================================
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoRuntimeSettings.java
=====================================
@@ -843,7 +843,7 @@ public final class GeckoRuntimeSettings extends RuntimeSettings {
         }
       }
     }
-    String acceptLanguages = locale != null ? locale.toString().replace('_', '-') : "en-US";
+    String acceptLanguages = locale != null ? locale.toLanguageTag().replace('_', '-') : "en-US";
     if (acceptLanguages.equals("en-US")) {
       // For consistency with spoof English.
       acceptLanguages += ", en";


=====================================
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/50d37108661976fece830973422d25a366ffe136...68c9e866f7e56a3976e7c22f4f8839b692e20731

-- 
This project does not include diff previews in email notifications.
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/50d37108661976fece830973422d25a366ffe136...68c9e866f7e56a3976e7c22f4f8839b692e20731
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/tbb-commits/attachments/20240527/c46dc8d5/attachment-0001.htm>


More information about the tbb-commits mailing list