Use official redux on background

This commit is contained in:
Shin'ya Ueoka 2018-07-08 11:08:56 +09:00
parent efa1cb3967
commit d781dfc786
5 changed files with 144 additions and 87 deletions

View file

@ -4,21 +4,24 @@ const openNewTab = async(
url, openerTabId, background = false, adjacent = false
) => {
if (!adjacent) {
return browser.tabs.create({ url, active: !background });
await browser.tabs.create({ url, active: !background });
return { type: '' };
}
let tabs = await browser.tabs.query({
active: true, currentWindow: true
});
return browser.tabs.create({
await browser.tabs.create({
url,
openerTabId,
active: !background,
index: tabs[0].index + 1
});
return { type: '' };
};
const openToTab = (url, tab) => {
return browser.tabs.update(tab.id, { url: url });
const openToTab = async(url, tab) => {
await browser.tabs.update(tab.id, { url: url });
return { type: '' };
};
const selected = (tabId) => {