mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-04 06:48:38 +09:00
Add a 'reason code' for when there isn't a reason string for a "corrupt extension"
This commit is contained in:
parent
8bf148471c
commit
f2d3eb036b
4 changed files with 80 additions and 4 deletions
|
|
@ -334,10 +334,27 @@ const gXPInstallObserver = {
|
|||
|
||||
messageString = gNavigatorBundle.getFormattedString(error, args);
|
||||
|
||||
if (install.error == AddonManager.ERROR_CORRUPT_FILE &&
|
||||
install.errorDetail &&
|
||||
typeof install.errorDetail == "string") {
|
||||
messageString += "\n" + "Details: " + install.errorDetail;
|
||||
if (install.error == AddonManager.ERROR_CORRUPT_FILE) {
|
||||
let detail = null;
|
||||
if (install.errorDetail !== undefined && install.errorDetail !== null) {
|
||||
detail = install.errorDetail;
|
||||
if (typeof detail != "string") {
|
||||
if (detail && typeof detail.message == "string" && detail.message) {
|
||||
detail = detail.message;
|
||||
} else {
|
||||
detail = String(detail);
|
||||
}
|
||||
}
|
||||
detail = detail.replace(/[\r\n\t]+/g, " ").trim();
|
||||
}
|
||||
|
||||
let detailString;
|
||||
if (detail) {
|
||||
detailString = gNavigatorBundle.getFormattedString("addonInstallErrorDetail", [detail]);
|
||||
} else {
|
||||
detailString = gNavigatorBundle.getFormattedString("addonInstallErrorDetailCode", [String(install.error)]);
|
||||
}
|
||||
messageString += " " + detailString;
|
||||
}
|
||||
|
||||
PopupNotifications.show(browser, notificationID, messageString, anchorID,
|
||||
|
|
|
|||
|
|
@ -93,6 +93,8 @@ addonLocalInstallError-4=%2$S could not be installed because %1$S cannot modify
|
|||
addonLocalInstallError-5=This add-on could not be installed because it has not been verified.
|
||||
addonLocalInstallError-8=%2$S could not be installed because %1$S does not support Jetpack (SDK) extensions.
|
||||
addonLocalInstallError-9=%2$S could not be installed because %1$S does not support WebExtensions.
|
||||
addonInstallErrorDetail=Reason: %S
|
||||
addonInstallErrorDetailCode=Reason code: %S
|
||||
|
||||
|
||||
# LOCALIZATION NOTE (addonInstallErrorIncompatible):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue