Skip to content

Commit 8fe0b29

Browse files
committed
selectUnpinnedTabAtIndex cleanup
1 parent e1e4f53 commit 8fe0b29

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

chrome/content/tabutils-pt.js

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -349,19 +349,9 @@ tabutils._phantomTabs = function() {
349349
}
350350
}, false);
351351

352-
gBrowser.selectUnpinnedTabAtIndex = function selectUnpinnedTabAtIndex(aIndex, aEvent) {
353-
var tabs = Array.filter(this.allTabs, function(aTab) !aTab.collapsed);
354-
if (aIndex < 0)
355-
aIndex += tabs.length;
352+
TU_hookCode("gBrowser.selectTabAtIndex", "this.visibleTabs", "this.visibleTabs.filter(function(aTab) !aTab.collapsed)");
356353

357-
if (aIndex >= 0 && aIndex < tabs.length)
358-
this.selectedTab = tabs[aIndex];
359-
360-
if (aEvent) {
361-
aEvent.preventDefault();
362-
aEvent.stopPropagation();
363-
}
364-
};
354+
gBrowser.selectUnpinnedTabAtIndex = TU_hookFunc(gBrowser.selectTabAtIndex, "visibleTabs", "allTabs");
365355

366356
gBrowser.selectPinnedTabAtIndex = function selectPinnedTabAtIndex(aIndex, aEvent) {
367357
var tabs = this.mTabContainer.mTabstrip._pinnedbox.childNodes;

0 commit comments

Comments
 (0)