Bug 1427188 - Add the openLinkIn() to utilityOverlay.js for add-on search to work. r=aceman,mkmelin
authorRichard Marti <richard.marti@gmail.com>
Wed, 27 Dec 2017 21:55:34 +0100
changeset 22944 dd64bc33f829ef8c87475e4eb0c3ab15b081415c
parent 22943 095948115b2c4613f42f50f7aedfc99f73e34fb2
child 22945 2639c3ea8ba0f3642ea0dadb2504f934b964ef12
push id13891
push usermozilla@jorgk.com
push dateSat, 30 Dec 2017 22:20:19 +0000
treeherdercomm-central@2639c3ea8ba0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaceman, mkmelin
bugs1427188
Bug 1427188 - Add the openLinkIn() to utilityOverlay.js for add-on search to work. r=aceman,mkmelin
mail/app/profile/all-thunderbird.js
mail/base/content/mailWindow.js
mail/base/content/utilityOverlay.js
--- a/mail/app/profile/all-thunderbird.js
+++ b/mail/app/profile/all-thunderbird.js
@@ -165,17 +165,17 @@ pref("extensions.legacy.enabled", true);
 
 // Preferences for AMO integration
 pref("extensions.getAddons.cache.enabled", true);
 pref("extensions.getAddons.maxResults", 15);
 pref("extensions.getAddons.get.url", "https://services.addons.mozilla.org/%LOCALE%/%APP%/api/%API_VERSION%/search/guid:%IDS%?src=thunderbird&appOS=%OS%&appVersion=%VERSION%");
 pref("extensions.getAddons.getWithPerformance.url", "https://services.addons.mozilla.org/%LOCALE%/%APP%/api/%API_VERSION%/search/guid:%IDS%?src=thunderbird&appOS=%OS%&appVersion=%VERSION%&tMain=%TIME_MAIN%&tFirstPaint=%TIME_FIRST_PAINT%&tSessionRestored=%TIME_SESSION_RESTORED%");
 pref("extensions.getAddons.link.url", "https://addons.mozilla.org/%LOCALE%/%APP%/");
 pref("extensions.getAddons.recommended.url", "https://services.addons.mozilla.org/%LOCALE%/%APP%/api/%API_VERSION%/list/recommended/all/%MAX_RESULTS%/%OS%/%VERSION%?src=thunderbird");
-pref("extensions.getAddons.search.browseURL", "https://addons.mozilla.org/%LOCALE%/%APP%/search?q=%TERMS%");
+pref("extensions.getAddons.search.browseURL", "https://addons.mozilla.org/%LOCALE%/%APP%/search/?q=%TERMS%");
 pref("extensions.getAddons.search.url", "https://services.addons.mozilla.org/%LOCALE%/%APP%/api/%API_VERSION%/search/%TERMS%/all/%MAX_RESULTS%/%OS%/%VERSION%/%COMPATIBILITY_MODE%?src=thunderbird");
 pref("extensions.webservice.discoverURL", "https://services.addons.mozilla.org/%LOCALE%/%APP%/discovery/pane/%VERSION%/%OS%");
 pref("extensions.getAddons.themes.browseURL", "https://addons.mozilla.org/%LOCALE%/thunderbird/themes/?src=thunderbird");
 
 // Blocklist preferences
 pref("extensions.blocklist.enabled", true);
 pref("extensions.blocklist.interval", 86400);
 pref("extensions.blocklist.url", "https://blocklist.addons.mozilla.org/blocklist/3/%APP_ID%/%APP_VERSION%/%PRODUCT%/%BUILD_ID%/%BUILD_TARGET%/%LOCALE%/%CHANNEL%/%OS_VERSION%/%DISTRIBUTION%/%DISTRIBUTION_VERSION%/%PING_COUNT%/%TOTAL_PING_COUNT%/%DAYS_SINCE_LAST_PING%/");
--- a/mail/base/content/mailWindow.js
+++ b/mail/base/content/mailWindow.js
@@ -773,12 +773,15 @@ function switchToTabHavingURI(aURI, aOpe
   }
 
   // Open the found matching tab.
   if (tabmail && matchingIndex > -1) {
     tabmail.switchToTab(matchingIndex);
     return true;
   }
 
-  // Open a new tab.
-  openContentTab(aURI, "tab");
+  if (aOpenNew) {
+    // Open a new tab.
+    openContentTab(aURI, "tab");
+  }
+
   return false;
 }
--- a/mail/base/content/utilityOverlay.js
+++ b/mail/base/content/utilityOverlay.js
@@ -318,8 +318,16 @@ function openDictionaryList(where) {
  * @param where the context to open the privacy policy in (e.g. 'tab',
  *        'window'). See openContentTab for more details.
  */
 function openPrivacyPolicy(where) {
   const kTelemetryInfoUrl = "toolkit.telemetry.infoURL";
   let url = Services.prefs.getCharPref(kTelemetryInfoUrl);
   openContentTab(url, where, "^http://www.mozilla.org/");
 }
+
+/* Used by the Add-on manager's search box */
+function openLinkIn(aURL, aWhere, aOpenParams) {
+  if (!aURL)
+    return;
+  // Open a new tab.
+  switchToTabHavingURI(aURL, true);
+}