From 31fe03e038bf8787ac9baee6596dae7027349462 Mon Sep 17 00:00:00 2001 From: Nick Krichevsky Date: Sat, 7 Mar 2015 11:31:15 -0500 Subject: [PATCH] Use callback when removing a tab --- popup.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/popup.js b/popup.js index 34ab415..fb70570 100644 --- a/popup.js +++ b/popup.js @@ -228,8 +228,9 @@ function setupTabs(tabs,callback){ tabList.forEach(function(windowTab){ var tabId = parseInt(windowTab.getAttribute("tabId")); if (tabId!==currentTab.id){ - chrome.tabs.remove(tabId); - windowTab.parentNode.removeChild(windowTab); + chrome.tabs.remove(tabId,function(){ + windowTab.parentNode.removeChild(windowTab); + }); } }); setTabCount(li.parentNode, 1);