From 318993d5cce8996265e7fce582bca5c4a69884e3 Mon Sep 17 00:00:00 2001 From: zombieFox Date: Sun, 12 Sep 2021 15:31:00 +0100 Subject: [PATCH] check if extension before opening all --- src/component/groupArea/index.js | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/component/groupArea/index.js b/src/component/groupArea/index.js index 1c43598a..b8c53853 100644 --- a/src/component/groupArea/index.js +++ b/src/component/groupArea/index.js @@ -182,21 +182,25 @@ export const GroupArea = function({ }), open: () => { - if (state.get.current().bookmark.newTab) { + if ('tabs' in chrome) { - groupData.group.items.forEach((item, i) => { - chrome.tabs.create({ url: item.url }); - }); + if (state.get.current().bookmark.newTab) { - } else { + groupData.group.items.forEach((item, i) => { + chrome.tabs.create({ url: item.url }); + }); - const first = groupData.group.items.shift(); + } else { - groupData.group.items.forEach((item, i) => { - chrome.tabs.create({ url: item.url }); - }); + const first = groupData.group.items.shift(); - window.location.href = first.url; + groupData.group.items.forEach((item, i) => { + chrome.tabs.create({ url: item.url }); + }); + + window.location.href = first.url; + + }; };