summaryrefslogtreecommitdiffstats
path: root/application/basilisk/components
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2019-01-28 15:56:37 +0100
committerwolfbeast <mcwerewolf@wolfbeast.com>2019-01-28 15:56:37 +0100
commit2cbbc5de4596ef3436685fa3316eeed9af700249 (patch)
tree07f68f5d4fb51e0902985bfdb3e692b1cc756100 /application/basilisk/components
parent2e581f48e5f2fa1b63d797b9aafc65bb7129b7d7 (diff)
downloadUXP-2cbbc5de4596ef3436685fa3316eeed9af700249.tar
UXP-2cbbc5de4596ef3436685fa3316eeed9af700249.tar.gz
UXP-2cbbc5de4596ef3436685fa3316eeed9af700249.tar.lz
UXP-2cbbc5de4596ef3436685fa3316eeed9af700249.tar.xz
UXP-2cbbc5de4596ef3436685fa3316eeed9af700249.zip
[BASILISK] Align browser glue with TychoAM for enableable add-ons.
Diffstat (limited to 'application/basilisk/components')
-rw-r--r--application/basilisk/components/nsBrowserGlue.js40
1 files changed, 20 insertions, 20 deletions
diff --git a/application/basilisk/components/nsBrowserGlue.js b/application/basilisk/components/nsBrowserGlue.js
index c2e215376..d77e97f87 100644
--- a/application/basilisk/components/nsBrowserGlue.js
+++ b/application/basilisk/components/nsBrowserGlue.js
@@ -1080,24 +1080,19 @@ BrowserGlue.prototype = {
// For any add-ons that were installed disabled and can be enabled offer
// them to the user.
- let win = RecentWindow.getMostRecentBrowserWindow();
- AddonManager.getAllAddons(addons => {
- for (let addon of addons) {
- // If this add-on has already seen (or seen is undefined for non-XPI
- // add-ons) then skip it.
- if (addon.seen !== false) {
- continue;
- }
-
- // If this add-on cannot be enabled (either already enabled or
- // appDisabled) then skip it.
- if (!(addon.permissions & AddonManager.PERM_CAN_ENABLE)) {
- continue;
- }
-
- win.openUILinkIn("about:newaddon?id=" + addon.id, "tab");
- }
- });
+ let changedIDs = AddonManager.getStartupChanges(AddonManager.STARTUP_CHANGE_INSTALLED);
+ if (changedIDs.length > 0) {
+ let win = this.getMostRecentBrowserWindow();
+ AddonManager.getAddonsByIDs(changedIDs, function(aAddons) {
+ aAddons.forEach(function(aAddon) {
+ // If the add-on isn't user disabled or can't be enabled then skip it.
+ if (!aAddon.userDisabled || !(aAddon.permissions & AddonManager.PERM_CAN_ENABLE))
+ return;
+
+ win.openUILinkIn("about:newaddon?id=" + aAddon.id, "tab");
+ })
+ });
+ }
let signingRequired;
if (AppConstants.MOZ_REQUIRE_SIGNING) {
@@ -1110,10 +1105,15 @@ BrowserGlue.prototype = {
let disabledAddons = AddonManager.getStartupChanges(AddonManager.STARTUP_CHANGE_DISABLED);
AddonManager.getAddonsByIDs(disabledAddons, (addons) => {
for (let addon of addons) {
- if (addon && addon.type == "experiment")
+ // WEs return null, skip.
+ if (!addon) {
+ continue;
+ }
+
+ if (addon.type == "experiment")
continue;
- if (addon && addon.signedState <= AddonManager.SIGNEDSTATE_MISSING) {
+ if (addon.signedState <= AddonManager.SIGNEDSTATE_MISSING) {
this._notifyUnsignedAddonsDisabled();
break;
}