Enhanced WebExtension support + detailed reason on why a extension is "corrupt"

This commit is contained in:
ownedbywuigi 2026-03-31 14:37:57 +01:00
commit c961f4e45c
4 changed files with 60 additions and 7 deletions

View file

@ -334,6 +334,12 @@ 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;
}
PopupNotifications.show(browser, notificationID, messageString, anchorID,
action, null, options);

View file

@ -88,6 +88,7 @@ function getBoolPref(prefname, def)
*/
function openUILink(url, event, aIgnoreButton, aIgnoreAlt, aAllowThirdPartyFixup,
aPostData, aReferrerURI) {
event = getRootEvent(event);
let params;
if (aIgnoreButton && typeof aIgnoreButton == "object") {
@ -112,6 +113,26 @@ function openUILink(url, event, aIgnoreButton, aIgnoreAlt, aAllowThirdPartyFixup
openUILinkIn(url, where, params);
}
// Utility function to inspect command events for wrapped middle-click events
// and return the originating event when available.
function getRootEvent(aEvent)
{
if (!aEvent) {
return aEvent;
}
let tempEvent = aEvent;
while (tempEvent.sourceEvent) {
if (tempEvent.sourceEvent.button == 1) {
aEvent = tempEvent.sourceEvent;
break;
}
tempEvent = tempEvent.sourceEvent;
}
return aEvent;
}
/* whereToOpenLink() looks at an event to decide where to open a link.
*