Pier Angelo Vendrame pushed to branch mullvad-browser-115.11.0esr-13.5-1 at The Tor Project / Applications / Mullvad Browser
Commits:
-
bc36a149
by Pier Angelo Vendrame at 2024-05-27T10:27:12+02:00
-
37ecad70
by Henry Wilkes at 2024-05-27T10:27:14+02:00
-
8649b2b1
by Henry Wilkes at 2024-05-27T10:27:14+02:00
-
6e6cdac6
by Henry Wilkes at 2024-05-27T10:27:14+02:00
6 changed files:
- browser/base/content/browser.xhtml
- + browser/base/content/droppedSupportNotification.js
- browser/base/content/languageNotification.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:
| ... | ... | @@ -123,6 +123,7 @@ |
| 123 | 123 | Services.scriptloader.loadSubScript("chrome://browser/content/search/autocomplete-popup.js", this);
|
| 124 | 124 | Services.scriptloader.loadSubScript("chrome://browser/content/search/searchbar.js", this);
|
| 125 | 125 | Services.scriptloader.loadSubScript("chrome://browser/content/languageNotification.js", this);
|
| 126 | + Services.scriptloader.loadSubScript("chrome://browser/content/droppedSupportNotification.js", this);
|
|
| 126 | 127 | |
| 127 | 128 | window.onload = gBrowserInit.onLoad.bind(gBrowserInit);
|
| 128 | 129 | window.onunload = gBrowserInit.onUnload.bind(gBrowserInit);
|
| 1 | +"use strict";
|
|
| 2 | + |
|
| 3 | +// Show a prompt that a user's system will no longer be supported.
|
|
| 4 | +window.addEventListener("load", () => {
|
|
| 5 | + let labelId;
|
|
| 6 | + // Expire date is 2024-10-01 (1st October 2024).
|
|
| 7 | + const isExpired = Date.now() > Date.UTC(2024, 9, 1);
|
|
| 8 | + |
|
| 9 | + if (
|
|
| 10 | + AppConstants.platform === "macosx" &&
|
|
| 11 | + Services.vc.compare(
|
|
| 12 | + Services.sysinfo.getProperty("version"),
|
|
| 13 | + "19.0" // MacOS 10.15 begins with Darwin 19.0
|
|
| 14 | + ) < 0
|
|
| 15 | + ) {
|
|
| 16 | + labelId = isExpired
|
|
| 17 | + ? "dropped-support-notification-macos-version-less-than-10-15-expired"
|
|
| 18 | + : "dropped-support-notification-macos-version-less-than-10-15";
|
|
| 19 | + } else if (
|
|
| 20 | + AppConstants.platform === "win" &&
|
|
| 21 | + Services.vc.compare(Services.sysinfo.getProperty("version"), "10.0") < 0
|
|
| 22 | + ) {
|
|
| 23 | + labelId = isExpired
|
|
| 24 | + ? "dropped-support-notification-win-os-version-less-than-10-expired"
|
|
| 25 | + : "dropped-support-notification-win-os-version-less-than-10";
|
|
| 26 | + }
|
|
| 27 | + |
|
| 28 | + const dismissedPref =
|
|
| 29 | + "browser.dropped_support_notification_v14.dismiss_version";
|
|
| 30 | + |
|
| 31 | + if (!labelId) {
|
|
| 32 | + // Avoid setting any preferences for supported versions, and clean up any
|
|
| 33 | + // old values if the user ported their profile.
|
|
| 34 | + Services.prefs.clearUserPref(dismissedPref);
|
|
| 35 | + return;
|
|
| 36 | + }
|
|
| 37 | + |
|
| 38 | + if (
|
|
| 39 | + !isExpired &&
|
|
| 40 | + Services.prefs.getStringPref(dismissedPref, "") ===
|
|
| 41 | + AppConstants.BASE_BROWSER_VERSION
|
|
| 42 | + ) {
|
|
| 43 | + // Already dismissed since the last update.
|
|
| 44 | + return;
|
|
| 45 | + }
|
|
| 46 | + |
|
| 47 | + const buttons = isExpired
|
|
| 48 | + ? undefined
|
|
| 49 | + : [
|
|
| 50 | + {
|
|
| 51 | + "l10n-id": "dropped-support-notification-dismiss-button",
|
|
| 52 | + callback: () => {
|
|
| 53 | + Services.prefs.setStringPref(
|
|
| 54 | + dismissedPref,
|
|
| 55 | + AppConstants.BASE_BROWSER_VERSION
|
|
| 56 | + );
|
|
| 57 | + },
|
|
| 58 | + },
|
|
| 59 | + ];
|
|
| 60 | + |
|
| 61 | + gNotificationBox.appendNotification(
|
|
| 62 | + "dropped-support-notification",
|
|
| 63 | + {
|
|
| 64 | + label: { "l10n-id": labelId },
|
|
| 65 | + priority: gNotificationBox.PRIORITY_WARNING_HIGH,
|
|
| 66 | + },
|
|
| 67 | + buttons
|
|
| 68 | + );
|
|
| 69 | +}); |
| ... | ... | @@ -2,7 +2,7 @@ |
| 2 | 2 | |
| 3 | 3 | // Show a prompt to suggest to the user that they can change the UI language.
|
| 4 | 4 | // Show it only the first time, and then do not show it anymore
|
| 5 | -window.addEventListener("load", async () => {
|
|
| 5 | +window.addEventListener("load", () => {
|
|
| 6 | 6 | const PREF_NAME = "intl.language_notification.shown";
|
| 7 | 7 | |
| 8 | 8 | if (Services.prefs.getBoolPref(PREF_NAME, false)) {
|
| ... | ... | @@ -35,12 +35,12 @@ window.addEventListener("load", async () => { |
| 35 | 35 | Services.locale.requestedLocales,
|
| 36 | 36 | Services.locale.availableLocales
|
| 37 | 37 | ).length;
|
| 38 | - const label = await document.l10n.formatValue(
|
|
| 39 | - matchingSystem
|
|
| 38 | + const label = {
|
|
| 39 | + "l10n-id": matchingSystem
|
|
| 40 | 40 | ? "language-notification-label-system"
|
| 41 | 41 | : "language-notification-label",
|
| 42 | - { language }
|
|
| 43 | - );
|
|
| 42 | + "l10n-args": { language },
|
|
| 43 | + };
|
|
| 44 | 44 | |
| 45 | 45 | const buttons = [
|
| 46 | 46 | {
|
| ... | ... | @@ -105,4 +105,5 @@ browser.jar: |
| 105 | 105 | content/browser/spotlight.js (content/spotlight.js)
|
| 106 | 106 | * content/browser/default-bookmarks.html (content/default-bookmarks.html)
|
| 107 | 107 | |
| 108 | + content/browser/droppedSupportNotification.js (content/droppedSupportNotification.js)
|
|
| 108 | 109 | content/browser/languageNotification.js (content/languageNotification.js) |
| ... | ... | @@ -843,7 +843,7 @@ public final class GeckoRuntimeSettings extends RuntimeSettings { |
| 843 | 843 | }
|
| 844 | 844 | }
|
| 845 | 845 | }
|
| 846 | - String acceptLanguages = locale != null ? locale.toString().replace('_', '-') : "en-US";
|
|
| 846 | + String acceptLanguages = locale != null ? locale.toLanguageTag().replace('_', '-') : "en-US";
|
|
| 847 | 847 | if (acceptLanguages.equals("en-US")) {
|
| 848 | 848 | // For consistency with spoof English.
|
| 849 | 849 | acceptLanguages += ", en";
|
| ... | ... | @@ -166,3 +166,21 @@ security-level-summary-custom = Your custom browser preferences have resulted in |
| 166 | 166 | # Button to undo custom changes to the security level and place the user in one of the standard security levels.
|
| 167 | 167 | # Shown in the security level panel and settings.
|
| 168 | 168 | security-level-restore-defaults-button = Restore defaults
|
| 169 | + |
|
| 170 | +## Notification for dropped operating system support.
|
|
| 171 | + |
|
| 172 | +# "{ -brand-short-name }" will be replaced with the localized name of the browser, e.g. "Tor Browser".
|
|
| 173 | +# "14.0" refers to the browser versions number: Tor Browser 14.0.
|
|
| 174 | +# "macOS" is a brand name, and 10.15 is the macOS version number.
|
|
| 175 | +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.
|
|
| 176 | +# "{ -brand-short-name }" will be replaced with the localized name of the browser, e.g. "Tor Browser".
|
|
| 177 | +# "macOS" is a brand name, and 10.15 is the macOS version number.
|
|
| 178 | +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.
|
|
| 179 | +# "{ -brand-short-name }" will be replaced with the localized name of the browser, e.g. "Tor Browser".
|
|
| 180 | +# "14.0" refers to the browser versions number: Tor Browser 14.0.
|
|
| 181 | +# "Windows" is a brand name, and "Windows 10" is the version.
|
|
| 182 | +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.
|
|
| 183 | +# "{ -brand-short-name }" will be replaced with the localized name of the browser, e.g. "Tor Browser".
|
|
| 184 | +# "Windows" is a brand name, and "Windows 10" is the version.
|
|
| 185 | +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.
|
|
| 186 | +dropped-support-notification-dismiss-button = Got it |