mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-07 00:08:39 +09:00
Enhanced WebExtension support + detailed reason on why a extension is "corrupt"
This commit is contained in:
parent
257ddfa48d
commit
c961f4e45c
4 changed files with 60 additions and 7 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue