aboutsummaryrefslogtreecommitdiffstats
path: root/tab-history.js
diff options
context:
space:
mode:
Diffstat (limited to 'tab-history.js')
-rw-r--r--tab-history.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/tab-history.js b/tab-history.js
index 1659e08..ff5b33b 100644
--- a/tab-history.js
+++ b/tab-history.js
@@ -66,6 +66,17 @@ var tabHistory = (function(){
if (i <= index)
--index;
}
+
+ for (let i = 1; i < history.length; ++i) {
+ let prevTab = history[i - 1],
+ currentTab = history[i];
+
+ if (prevTab === currentTab) {
+ history.splice(i, 1);
+ if (i <= index)
+ --index;
+ }
+ }
}
function addHistory (aTab) {