Merge remote-tracking branch 'origin/master' into background-adjacent-tabs

This commit is contained in:
Shin'ya Ueoka 2018-05-01 13:51:07 +09:00
commit 4d7c24f38a
120 changed files with 14625 additions and 1641 deletions

View file

@ -1,5 +1,21 @@
const openNewTab = (url, openerTabId, background = false, adjacent = false) => {
if (adjacent) {
return browser.tabs.query({
active: true, currentWindow: true
}).then((tabs) => {
return browser.tabs.create({
url,
openerTabId,
active: !background,
index: tabs[0].index + 1
});
});
}
return browser.tabs.create({ url, active: !background });
};
const openToTab = (url, tab) => {
return browser.tabs.update(tab.id, { url: url });
};
export { openToTab };
export { openNewTab, openToTab };