diff options
Diffstat (limited to 'toolkit/mozapps/extensions')
7 files changed, 66 insertions, 43 deletions
diff --git a/toolkit/mozapps/extensions/AddonManager.jsm b/toolkit/mozapps/extensions/AddonManager.jsm index 51030cb56..681c4240a 100644 --- a/toolkit/mozapps/extensions/AddonManager.jsm +++ b/toolkit/mozapps/extensions/AddonManager.jsm @@ -2672,7 +2672,7 @@ this.AddonManager = { // An error occured trying to write to the filesystem. ERROR_FILE_ACCESS: -4, // The downloaded file seems to be WebExtension. - ERROR_WEBEXT_FILE: -5, + ERROR_WEBEXT_FILE: -9, // These must be kept in sync with AddonUpdateChecker. // No error was encountered. diff --git a/toolkit/mozapps/extensions/content/extensions.xml b/toolkit/mozapps/extensions/content/extensions.xml index 9c15902b5..fab340540 100644 --- a/toolkit/mozapps/extensions/content/extensions.xml +++ b/toolkit/mozapps/extensions/content/extensions.xml @@ -1307,14 +1307,6 @@ this._errorLink.value = gStrings.ext.GetStringFromName("notification.blocked.link"); this._errorLink.href = this.mAddon.blocklistURL; this._errorLink.hidden = false; - } else if (this.mAddon.jetsdk) { - this.setAttribute("notification", "warning"); - this._warning.textContent = gStrings.ext.formatStringFromName( - "notification.jetsdk", - [gStrings.brandShortName, gStrings.appVersion], 2 - ); - this._warningLink.hidden = true; - this._warningBtn.hidden = true; } else if ((!isUpgrade && !this.mAddon.isCompatible) && (AddonManager.checkCompatibility || (this.mAddon.blocklistState != Ci.nsIBlocklistService.STATE_SOFTBLOCKED))) { this.setAttribute("notification", "warning"); diff --git a/toolkit/mozapps/extensions/content/selectAddons.js b/toolkit/mozapps/extensions/content/selectAddons.js index 33ab8a84e..f80932b3f 100644 --- a/toolkit/mozapps/extensions/content/selectAddons.js +++ b/toolkit/mozapps/extensions/content/selectAddons.js @@ -123,7 +123,11 @@ var gChecking = { if (this._completeCount < this._addonCount) return; - var addons = [gAddons[id] for (id in gAddons)]; + // Tycho: var addons = [gAddons[id] for (id in gAddons)]; + var addons = []; + for (let id in gAddons) { + addons.push(gAddons[id]) + } addons.sort(function sortAddons(a, b) { let orderA = orderForScope(a.addon.scope); diff --git a/toolkit/mozapps/extensions/content/update.js b/toolkit/mozapps/extensions/content/update.js index 4e44b4f5e..3d87f4d4b 100644 --- a/toolkit/mozapps/extensions/content/update.js +++ b/toolkit/mozapps/extensions/content/update.js @@ -131,7 +131,13 @@ var gUpdateWizard = { if (gMismatchPage.waiting) { logger.info("Dialog closed in mismatch page"); if (gUpdateWizard.addonInstalls.size > 0) { - gInstallingPage.startInstalls([i for ([, i] of gUpdateWizard.addonInstalls)]); + // Tycho: gInstallingPage.startInstalls([i for ([, i] of gUpdateWizard.addonInstalls)]); + let results = []; + for (let [, i] of gUpdateWizard.addonInstalls) { + results.push(i); + } + + gInstallingPage.startInstalls(results); } return true; } @@ -196,7 +202,13 @@ var gVersionInfoPage = { } } // Fetch the add-ons that are still affected by this update. - let idlist = [id for (id of gUpdateWizard.affectedAddonIDs)]; + // Tycho: let idlist = [id for (id of gUpdateWizard.affectedAddonIDs)]; + + let idlist = []; + for (let id of gUpdateWizard.affectedAddonIDs) { + idlist.push(id); + } + if (idlist.length < 1) { gVersionInfoPage.onAllUpdatesFinished(); return; @@ -206,7 +218,16 @@ var gVersionInfoPage = { let fetchedAddons = yield new Promise((resolve, reject) => AddonManager.getAddonsByIDs(idlist, resolve)); // We shouldn't get nulls here, but let's be paranoid... - gUpdateWizard.addons = [a for (a of fetchedAddons) if (a)]; + // Tycho: gUpdateWizard.addons = [a for (a of fetchedAddons) if (a)]; + let results = []; + for (let a of fetchedAddons) { + if (a) { + results.push(a); + } + } + + gUpdateWizard.addons = results; + if (gUpdateWizard.addons.length < 1) { gVersionInfoPage.onAllUpdatesFinished(); return; @@ -234,8 +255,18 @@ var gVersionInfoPage = { AddonManagerPrivate.recordSimpleMeasure("appUpdate_upgradeFailed", 0); AddonManagerPrivate.recordSimpleMeasure("appUpdate_upgradeDeclined", 0); // Filter out any add-ons that are now enabled. - logger.debug("VersionInfo updates finished: found " + - [addon.id + ":" + addon.appDisabled for (addon of gUpdateWizard.addons)].toSource()); + // Tycho: + // logger.debug("VersionInfo updates finished: found " + + // [addon.id + ":" + addon.appDisabled for (addon of gUpdateWizard.addons)].toSource()); + + let logDisabledAddons = []; + for (let addon of gUpdateWizard.addons) { + if (addon.appDisabled) { + logDisabledAddons.push(addon.id + ":" + addon.appDisabled); + } + } + logger.debug("VersionInfo updates finished: found " + logDisabledAddons.toSource()); + let filteredAddons = []; for (let a of gUpdateWizard.addons) { if (a.appDisabled) { @@ -252,7 +283,13 @@ var gVersionInfoPage = { if (gUpdateWizard.shuttingDown) { // jump directly to updating auto-update add-ons in the background if (gUpdateWizard.addonInstalls.size > 0) { - gInstallingPage.startInstalls([i for ([, i] of gUpdateWizard.addonInstalls)]); + // Tycho: gInstallingPage.startInstalls([i for ([, i] of gUpdateWizard.addonInstalls)]); + let results = []; + for (let [, i] of gUpdateWizard.addonInstalls) { + results.push(i); + } + + gInstallingPage.startInstalls(results); } return; } @@ -478,8 +515,16 @@ var gInstallingPage = { return; } - logger.debug("Start installs for " - + [i.existingAddon.id for (i of aInstallList)].toSource()); + // Tycho: + // logger.debug("Start installs for " + // + [i.existingAddon.id for (i of aInstallList)].toSource()); + + let logInstallAddons = []; + for (let i of aInstallList) { + logInstallAddons.push(i.existingAddon.id); + } + logger.debug("Start installs for " + logInstallAddons.toSource()); + this._errors = []; this._installs = aInstallList; this._installing = true; diff --git a/toolkit/mozapps/extensions/internal/AddonUpdateChecker.jsm b/toolkit/mozapps/extensions/internal/AddonUpdateChecker.jsm index 7e86fceab..d68a0f175 100644 --- a/toolkit/mozapps/extensions/internal/AddonUpdateChecker.jsm +++ b/toolkit/mozapps/extensions/internal/AddonUpdateChecker.jsm @@ -765,8 +765,9 @@ this.AddonUpdateChecker = { * @return UpdateParser so that the caller can use UpdateParser.cancel() to shut * down in-progress update requests */ - checkForUpdates: function AUC_checkForUpdates(aId, aUpdateKey, aUrl, - aObserver) { - return new UpdateParser(aId, aUpdateKey, aUrl, aObserver); + checkForUpdates: function AUC_checkForUpdates(aId, aUpdateKey, aUrl, aObserver) { + // Exclude default theme + if (aId != "{972ce4c6-7e08-4474-a285-3208198ce6fd}") + return new UpdateParser(aId, aUpdateKey, aUrl, aObserver); } }; diff --git a/toolkit/mozapps/extensions/internal/XPIProvider.jsm b/toolkit/mozapps/extensions/internal/XPIProvider.jsm index 975448fcc..54b86edc4 100644 --- a/toolkit/mozapps/extensions/internal/XPIProvider.jsm +++ b/toolkit/mozapps/extensions/internal/XPIProvider.jsm @@ -635,9 +635,6 @@ function isUsableAddon(aAddon) { if (aAddon.type == "theme" && aAddon.internalName == XPIProvider.defaultSkin) return true; - if (aAddon.jetsdk) - return false; - if (aAddon.blocklistState == Blocklist.STATE_BLOCKED) return false; @@ -1116,23 +1113,7 @@ function loadManifestFromZipReader(aZipReader) { } else { addon.hasBinaryComponents = false; } - - // Set a boolean value whether the .xpi archive contains file related to old - // Mozilla Add-on SDK or contains file related to PMkit (or new Mozilla SDK), - // but extension is not directly targeting Pale Moon - if (aZipReader.hasEntry("harness-options.json")) { - addon.jetsdk = true; - } else if (aZipReader.hasEntry("package.json")) { - let app = addon.matchingTargetApplication; - if (app && app.id == Services.appinfo.ID) { - addon.jetsdk = false; - } else { - addon.jetsdk = true; - } - } else { - addon.jetsdk = false; - } - + addon.appDisabled = !isUsableAddon(addon); return addon; } @@ -6731,7 +6712,7 @@ function AddonWrapper(aAddon) { "providesUpdatesSecurely", "blocklistState", "blocklistURL", "appDisabled", "softDisabled", "skinnable", "size", "foreignInstall", "hasBinaryComponents", "strictCompatibility", "compatibilityOverrides", "updateURL", - "getDataDirectory", "multiprocessCompatible", "jetsdk", "native"].forEach(function(aProp) { + "getDataDirectory", "multiprocessCompatible", "native"].forEach(function(aProp) { this.__defineGetter__(aProp, function AddonWrapper_propertyGetter() aAddon[aProp]); }, this); diff --git a/toolkit/mozapps/extensions/internal/XPIProviderUtils.js b/toolkit/mozapps/extensions/internal/XPIProviderUtils.js index d4798b726..2cef907f1 100644 --- a/toolkit/mozapps/extensions/internal/XPIProviderUtils.js +++ b/toolkit/mozapps/extensions/internal/XPIProviderUtils.js @@ -70,7 +70,7 @@ const PROP_JSON_FIELDS = ["id", "syncGUID", "location", "version", "type", "skinnable", "size", "sourceURI", "releaseNotesURI", "softDisabled", "foreignInstall", "hasBinaryComponents", "strictCompatibility", "locales", "targetApplications", - "targetPlatforms", "multiprocessCompatible", "jetsdk", "native"]; + "targetPlatforms", "multiprocessCompatible", "native"]; // Time to wait before async save of XPI JSON database, in milliseconds const ASYNC_SAVE_DELAY_MS = 20; |