Merge remote-tracking branch 'origin/master' into background-adjacent-tabs
This commit is contained in:
commit
4d7c24f38a
120 changed files with 14625 additions and 1641 deletions
|
@ -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 };
|
||||
|
|
Reference in a new issue