aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--background_page.html9
1 files changed, 8 insertions, 1 deletions
diff --git a/background_page.html b/background_page.html
index da803e99..0aeb2a25 100644
--- a/background_page.html
+++ b/background_page.html
@@ -341,7 +341,14 @@
if (!openTabInfo) { return; } // This tab might've been opened before the extension was installed.
// If we restore the new tab page, it'll ignore Vimium keystrokes when it reappears.
- if (openTabInfo.url == "chrome://newtab/") { return; }
+ // Pretend it never existed and adjust tab indices accordingly.
+ if (openTabInfo.url == "chrome://newtab/") {
+ for (var i in tabQueue[openTabInfo.windowId]) {
+ if (tabQueue[openTabInfo.windowId][i].positionIndex > openTabInfo.positionIndex) {
+ tabQueue[openTabInfo.windowId][i].positionIndex--;
+ }
+ }
+ }
if (tabQueue[openTabInfo.windowId])
tabQueue[openTabInfo.windowId].push(openTabInfo);