From e678622b8ce2113431598177e148e8a32dfc0e77 Mon Sep 17 00:00:00 2001 From: sainaen Date: Tue, 7 May 2013 20:02:58 +0300 Subject: Remove the callback parameter of removeTab() callback parameter is never passed to removeTab(), so adding it to the selectionChangeHandlers list causes 'Can not call method call() of undefined' error after closing the tab. --- background_scripts/main.coffee | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'background_scripts') diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee index 71f963b2..c585c265 100644 --- a/background_scripts/main.coffee +++ b/background_scripts/main.coffee @@ -234,12 +234,9 @@ BackgroundCommands = previousTab: (callback) -> selectTab(callback, "previous") firstTab: (callback) -> selectTab(callback, "first") lastTab: (callback) -> selectTab(callback, "last") - removeTab: (callback) -> + removeTab: -> chrome.tabs.getSelected(null, (tab) -> - chrome.tabs.remove(tab.id) - # We can't just call the callback here because we need to wait - # for the selection to change to consider this action done. - selectionChangedHandlers.push(callback)) + chrome.tabs.remove(tab.id)) restoreTab: (callback) -> # TODO(ilya): Should this be getLastFocused instead? chrome.windows.getCurrent((window) -> -- cgit v1.2.3