Bug 1430153 - Warm up tabs in the Ctrl+Tab panel. r?mconley
MozReview-Commit-ID: IlXLt90MsrB
--- 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);
},