Bug 1430153 - Warm up tabs in the Ctrl+Tab panel. r=mconley
authorDão Gottwald <dao@mozilla.com>
Fri, 12 Jan 2018 17:09:15 +0100
changeset 399020 4c5b03b42277706d51b489f05dc21592e82f100e
parent 399019 f345451c208356279254fdf5efa95fbad83abcbd
child 399021 8c2097e148288b26439cf0aa000b10a6fd82ca11
push id57965
push userdgottwald@mozilla.com
push dateFri, 12 Jan 2018 16:27:27 +0000
treeherderautoland@4c5b03b42277 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmconley
bugs1430153
milestone59.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 1430153 - Warm up tabs in the Ctrl+Tab panel. r=mconley MozReview-Commit-ID: IlXLt90MsrB
browser/base/content/browser-ctrlTab.js
--- a/browser/base/content/browser-ctrlTab.js
+++ b/browser/base/content/browser-ctrlTab.js
@@ -283,16 +283,20 @@ var ctrlTab = {
 
     if (this._selectedIndex == -1) {
       // Focus is already in the panel.
       this.previews[selectedIndex].focus();
     } else {
       this._selectedIndex = selectedIndex;
     }
 
+    if (this.previews[selectedIndex]._tab) {
+      gBrowser.warmupTab(this.previews[selectedIndex]._tab);
+    }
+
     if (this._timer) {
       clearTimeout(this._timer);
       this._timer = null;
       this._openPanel();
     }
   },
 
   _mouseOverFocus: function ctrlTab_mouseOverFocus(aPreview) {
@@ -343,16 +347,17 @@ var ctrlTab = {
   open: function ctrlTab_open() {
     if (this.isOpen)
       return;
 
     document.addEventListener("keyup", this, true);
 
     this.updatePreviews();
     this._selectedIndex = 1;
+    gBrowser.warmupTab(this.selected._tab);
 
     // Add a slight delay before showing the UI, so that a quick
     // "ctrl-tab" keypress just flips back to the MRU tab.
     this._timer = setTimeout(function(self) {
       self._timer = null;
       self._openPanel();
     }, 200, this);
   },