Bug 1137234 - Make middle clicks on search suggestions on about:home, about:newtab open search results in a background tab. r=adw
authorKeita Mimura <k-mimura@onu.edu>
Tue, 07 Apr 2015 11:35:38 -0700
changeset 238128 af2151f856fbfe2391827c9d019dd661401bc4a5
parent 237988 ec70706deeec92c814353edb895258c91f20dcf0
child 238129 89e45c21e6314fde45ad73da2104cf70903c9155
push id28556
push userryanvm@gmail.com
push dateWed, 08 Apr 2015 16:40:55 +0000
treeherdermozilla-central@2c92a7df87c9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersadw
bugs1137234
milestone40.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1137234 - Make middle clicks on search suggestions on about:home, about:newtab open search results in a background tab. r=adw
browser/modules/AboutHome.jsm
browser/modules/ContentSearch.jsm
--- a/browser/modules/AboutHome.jsm
+++ b/browser/modules/AboutHome.jsm
@@ -196,17 +196,17 @@ let AboutHome = {
 
           let engine = Services.search.currentEngine;
           if (AppConstants.MOZ_SERVICES_HEALTHREPORT) {
             window.BrowserSearch.recordSearchInHealthReport(engine, "abouthome", data.selection);
           }
 
           // Trigger a search through nsISearchEngine.getSubmission()
           let submission = engine.getSubmission(data.searchTerms, null, "homepage");
-          let where = data.useNewTab ? "tab" : "current";
+          let where = data.useNewTab ? "tabshifted" : "current";
           window.openUILinkIn(submission.uri.spec, where, false,
                               submission.postData);
 
           // Used for testing
           let mm = aMessage.target.messageManager;
           mm.sendAsyncMessage("AboutHome:SearchTriggered", aMessage.data.searchData);
         });
 
--- a/browser/modules/ContentSearch.jsm
+++ b/browser/modules/ContentSearch.jsm
@@ -221,19 +221,16 @@ this.ContentSearch = {
                                submission.postData);
     }
     catch (err) {
       // The browser may have been closed between the time its content sent the
       // message and the time we handle it.  In that case, trying to call any
       // method on it will throw.
       return Promise.resolve();
     }
-    if (data.useNewTab) {
-      browser.getTabBrowser().selectedTab = newTab;
-    }
     let win = browser.ownerDocument.defaultView;
     win.BrowserSearch.recordSearchInHealthReport(engine, data.whence,
                                                  data.selection || null);
     return Promise.resolve();
   },
 
   _onMessageSetCurrentEngine: function (msg, data) {
     Services.search.currentEngine = Services.search.getEngineByName(data);