From c1b339961c07b1732bc61aec26050bb1bf5e62ac Mon Sep 17 00:00:00 2001 From: Stephen Sigwart Date: Fri, 25 Oct 2019 23:01:49 -0400 Subject: [PATCH] Package install via Open link. Closes #3792 --- src/modules/scope_packages/content/packages.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/modules/scope_packages/content/packages.js b/src/modules/scope_packages/content/packages.js index bac92d0f04..8b4bc3e20b 100644 --- a/src/modules/scope_packages/content/packages.js +++ b/src/modules/scope_packages/content/packages.js @@ -280,7 +280,13 @@ this.onSelectResult = function() { var result = commando.getSelectedResult(); - require("./manage").installPackage(result.data.package, function() + var pkg = null; + if (result.data && result.data.package) + pkg = result.data.package; + // Handle "Open" option when viewing a package + else if (result.subscope && result.subscope.data && result.subscope.data.package) + pkg = result.subscope.data.package; + require("./manage").installPackage(pkg, function() { commando.refresh(); commando.hide.bind(commando); @@ -587,7 +593,7 @@ this.isSystemAddon = function(id) { var addon = _cache.addons[id] || null; - if (addon && addon.scope == AddonManager.SCOPE_APPLICATION || addon.scope == AddonManager.SCOPE_SYSTEM) + if (addon && (addon.scope == AddonManager.SCOPE_APPLICATION || addon.scope == AddonManager.SCOPE_SYSTEM)) return true; return false; }