diff --git a/mobile/android/chrome/content/aboutAddons.js b/mobile/android/chrome/content/aboutAddons.js index de1c796808ce..c6a634158e14 100644 --- a/mobile/android/chrome/content/aboutAddons.js +++ b/mobile/android/chrome/content/aboutAddons.js @@ -102,7 +102,6 @@ function init() { Addons.init(); showList(); ContextMenus.init(); - } @@ -111,14 +110,9 @@ function uninit() { AddonManager.removeAddonListener(Addons); } -function openLink(aEvent) { - try { - let formatter = Cc["@mozilla.org/toolkit/URLFormatterService;1"].getService(Ci.nsIURLFormatter); - - let url = formatter.formatURLPref(aEvent.currentTarget.getAttribute("pref")); - let BrowserApp = gChromeWin.BrowserApp; - BrowserApp.addTab(url, { selected: true, parentId: BrowserApp.selectedTab.id }); - } catch (ex) {} +function openLink(url) { + let BrowserApp = gChromeWin.BrowserApp; + BrowserApp.addTab(url, { selected: true, parentId: BrowserApp.selectedTab.id }); } function onPopState(aEvent) { @@ -194,8 +188,14 @@ var Addons = { let outer = document.createElement("div"); outer.className = "addon-item list-item"; outer.setAttribute("role", "button"); - outer.setAttribute("pref", "extensions.getAddons.browseAddons"); - outer.addEventListener("click", openLink, true); + outer.addEventListener("click", function(event) { + try { + let formatter = Cc["@mozilla.org/toolkit/URLFormatterService;1"].getService(Ci.nsIURLFormatter); + openLink(formatter.formatURLPref("extensions.getAddons.browseAddons")); + } catch (e) { + Cu.reportError(e); + } + }, true); let img = document.createElement("img"); img.className = "icon"; @@ -236,6 +236,7 @@ var Addons = { let item = this._createItem(aAddon); item.setAttribute("isDisabled", !aAddon.isActive); + item.setAttribute("isUnsigned", aAddon.signedState <= AddonManager.SIGNEDSTATE_MISSING); item.setAttribute("opType", opType); item.setAttribute("updateable", updateable); if (blocked) @@ -276,6 +277,10 @@ var Addons = { document.getElementById("cancel-btn").addEventListener("click", Addons.cancelUninstall.bind(this), false); document.getElementById("disable-btn").addEventListener("click", Addons.disable.bind(this), false); document.getElementById("enable-btn").addEventListener("click", Addons.enable.bind(this), false); + + document.getElementById("unsigned-learn-more").addEventListener("click", function() { + openLink(Services.urlFormatter.formatURLPref("app.support.baseURL") + "unsigned-addons"); + }, false); }, _getOpTypeForOperations: function _getOpTypeForOperations(aOperations) { @@ -307,6 +312,7 @@ var Addons = { let detailItem = document.querySelector("#addons-details > .addon-item"); detailItem.setAttribute("isDisabled", aListItem.getAttribute("isDisabled")); + detailItem.setAttribute("isUnsigned", aListItem.getAttribute("isUnsigned")); detailItem.setAttribute("opType", aListItem.getAttribute("opType")); detailItem.setAttribute("optionsURL", aListItem.getAttribute("optionsURL")); let addon = detailItem.addon = aListItem.addon; diff --git a/mobile/android/chrome/content/aboutAddons.xhtml b/mobile/android/chrome/content/aboutAddons.xhtml index f5f00eb87ec5..42d9cfa9c105 100644 --- a/mobile/android/chrome/content/aboutAddons.xhtml +++ b/mobile/android/chrome/content/aboutAddons.xhtml @@ -47,6 +47,7 @@
+