aboutsummaryrefslogtreecommitdiff
path: root/src/background
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2017-10-10 22:18:47 +0900
committerGitHub <noreply@github.com>2017-10-10 22:18:47 +0900
commitc38ac6f545b414d33d9aebedbc4aa91ff471701c (patch)
tree3f8e61ff958278c8ed53913ad2d000b63d237dc1 /src/background
parent77cc3778032a1cc774e26aa3ebe43991b3b4d5cf (diff)
parent142c7d45f44e6abed2a726d4f142d705ea55291f (diff)
Merge pull request #46 from ueokande/fix-42
Fix errors on tabs selection
Diffstat (limited to 'src/background')
-rw-r--r--src/background/tabs.js4
1 files 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 });