Bug 600862 - Clicking 'Learn More' button in Add-ons Manager results in going to ebay.com [r=mbrubeck]
authorMark Finkle <mfinkle@mozilla.com>
Thu, 30 Sep 2010 21:36:35 -0400
changeset 66766 6d5cbe6e8e16cb49c9cb4041b2eec13152b3f249
parent 66765 0a2a6d79c55270747a30b4b44910bddd9babe7ba
child 66767 d87b30c0647d5167d0dd424b9691a940e868dbae
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmbrubeck
bugs600862
Bug 600862 - Clicking 'Learn More' button in Add-ons Manager results in going to ebay.com [r=mbrubeck]
mobile/chrome/content/extensions.js
--- a/mobile/chrome/content/extensions.js
+++ b/mobile/chrome/content/extensions.js
@@ -525,30 +525,33 @@ var ExtensionsView = {
 
       let item = this._list.appendChild(listitem);
     }
   },
 
   displayRecommendedResults: function ev_displaySearchResults(aRecommendedAddons, aBrowseAddons) {
     this.clearSection("repo");
 
+    let formatter = Cc["@mozilla.org/toolkit/URLFormatterService;1"].getService(Ci.nsIURLFormatter);
+    let browseURL = formatter.formatURLPref("extensions.getAddons.browseAddons");
+
     let strings = Elements.browserBundle;
     let brandBundle = document.getElementById("bundle_brand");
     let brandShortName = brandBundle.getString("brandShortName");
 
     let whatare = document.createElement("richlistitem");
     whatare.setAttribute("typeName", "banner");
     whatare.setAttribute("label", strings.getString("addonsWhatAre.label"));
 
     let desc = strings.getString("addonsWhatAre.description");
     desc = desc.replace(/#1/g, brandShortName);
     whatare.setAttribute("description", desc);
 
     whatare.setAttribute("button", strings.getString("addonsWhatAre.button"));
-    whatare.setAttribute("onbuttoncommand", "BrowserUI.newTab('http://ebay.com');");
+    whatare.setAttribute("onbuttoncommand", "BrowserUI.newTab('" + browseURL + "');");
     this._list.appendChild(whatare);
 
     if (aRecommendedAddons.length == 0 && aBrowseAddons.length == 0) {
       let msg = strings.getString("addonsSearchNone.recommended");
       let button = strings.getString("addonsSearchNone.button");
       let item = this.displaySectionMessage("repo", msg, button, true);
 
       this._list.scrollBoxObject.scrollToElement(item);
@@ -565,24 +568,21 @@ var ExtensionsView = {
     function ratingCompare(a, b) {
       return a.averageRating < b.averageRating;
     }
     aBrowseAddons.sort(ratingCompare);
 
     this.appendSearchResults(aRecommendedAddons, false);
     this.appendSearchResults(aBrowseAddons, true);
 
-    let formatter = Cc["@mozilla.org/toolkit/URLFormatterService;1"].getService(Ci.nsIURLFormatter);
-
     let showmore = document.createElement("richlistitem");
     showmore.setAttribute("typeName", "showmore");
     showmore.setAttribute("label", strings.getString("addonsBrowseAll.label"));
 
-    let url = formatter.formatURLPref("extensions.getAddons.browseAddons");
-    showmore.setAttribute("url", url);
+    showmore.setAttribute("url", browseURL);
     this._list.appendChild(showmore);
   },
 
   displaySearchResults: function ev_displaySearchResults(aAddons, aTotalResults, aSelectFirstResult) {
     this.clearSection("repo");
 
     let strings = Elements.browserBundle;
     if (aAddons.length == 0) {