summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGaming4JC <g4jc@bulletmail.org>2019-03-16 15:10:10 -0400
committerGaming4JC <g4jc@bulletmail.org>2019-03-16 15:10:10 -0400
commit6b5f2d2bc107d13b0730d0b2fd9a7036db8724c6 (patch)
tree77083ce9c903afc818e36da034be1b5b34b7ef5c
parent062ee85eff30a1d256a56a615e0a3486176c83b4 (diff)
downloadiceweasel-uxp-6b5f2d2bc107d13b0730d0b2fd9a7036db8724c6.tar.gz
backport uxp #937: Align browser glue with TychoAM for enableable addons.
-rw-r--r--components/nsBrowserGlue.js36
1 files changed, 18 insertions, 18 deletions
diff --git a/components/nsBrowserGlue.js b/components/nsBrowserGlue.js
index eacd1d0..21cd8ac 100644
--- a/components/nsBrowserGlue.js
+++ b/components/nsBrowserGlue.js
@@ -930,24 +930,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) {
@@ -960,6 +955,11 @@ BrowserGlue.prototype = {
let disabledAddons = AddonManager.getStartupChanges(AddonManager.STARTUP_CHANGE_DISABLED);
AddonManager.getAddonsByIDs(disabledAddons, (addons) => {
for (let addon of addons) {
+ // WEs return null, skip.
+ if (!addon) {
+ continue;
+ }
+
if (addon.type == "experiment")
continue;