From 142c7d45f44e6abed2a726d4f142d705ea55291f Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Tue, 10 Oct 2017 22:11:19 +0900 Subject: [PATCH] fix errors on tabs selection --- src/background/tabs.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/background/tabs.js b/src/background/tabs.js index 166af4d..eed3252 100644 --- a/src/background/tabs.js +++ b/src/background/tabs.js @@ -18,12 +18,12 @@ const reopenTab = () => { }; const selectAt = (index) => { - return browser.tabs.query({ currentWindow: true }, (tabs) => { + return browser.tabs.query({ currentWindow: true }).then((tabs) => { if (tabs.length < 2) { return; } if (index < 0 || tabs.length <= index) { - throw new RangeError(`tab ${index} does not exist`); + throw new RangeError(`tab ${index + 1} does not exist`); } let id = tabs[index].id; return browser.tabs.update(id, { active: true });