Include commands tabcloseAllToRight and tabcloseAllToLeft closing
all tabs to the left/right of the active one. No default binding
included.
This commit is contained in:
Bruno Oliveira 2018-05-03 17:07:24 -03:00 committed by Oliver Blanthorn
parent 59ed93b286
commit b1365e134e
No known key found for this signature in database
GPG key ID: 2BB8C36BB504BFF3

View file

@ -1269,6 +1269,36 @@ export async function tabclose(...indexes: string[]) {
}
}
/** Close all tabs to the right of the current one
*
*/
//#background
export async function tabcloseAllToRight() {
const tabs = await browser.tabs.query({
pinned: false,
currentWindow: true,
})
const atab = await activeTab()
let ids = tabs.filter(tab => tab.index > atab.index).map(tab => tab.id)
browser.tabs.remove(ids)
}
/** Close all tabs to the left of the current one
*
*/
//#background
export async function tabcloseAllToLeft() {
const tabs = await browser.tabs.query({
pinned: false,
currentWindow: true,
})
const atab = await activeTab()
let ids = tabs.filter(tab => tab.index < atab.index).map(tab => tab.id)
browser.tabs.remove(ids)
}
/** restore most recently closed tab in this window unless the most recently closed item was a window */
//#background
export async function undo() {