Skip to content
Snippets Groups Projects
Verified Commit 9693c926 authored by henry's avatar henry Committed by ma1
Browse files

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

parent 9e05ca8c
No related branches found
No related tags found
1 merge request!1326Bug 43383: Rebased legacy onto 115.19.0esr
......@@ -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);
......
"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
);
});
......@@ -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)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment