From 2c97f8a4f3b31d38922783b8f5e6237da33ce86b Mon Sep 17 00:00:00 2001 From: Daniel Campoverde Date: Sun, 29 Oct 2017 22:01:12 -0500 Subject: Fix selectFirstTab --- src/background/tabs.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/background/tabs.js b/src/background/tabs.js index 423e84a..2028503 100644 --- a/src/background/tabs.js +++ b/src/background/tabs.js @@ -80,8 +80,10 @@ const selectNextTab = (current, count) => { }; const selectFirstTab = (current, count) => { - let id = tabs[0].id; - return browser.tabs.update(id, { active: true }); + return browser.tabs.query({ currentWindow: true }).then((tabs) => { + let id = tabs[0].id; + return browser.tabs.update(id, { active: true }); + }); }; // const selectFirstTab = (current, count) => { -- cgit v1.2.3