mirror of
https://github.com/vale981/tridactyl
synced 2025-03-05 09:31:41 -05:00
Add tabclose functionality
This commit is contained in:
parent
f777e9d396
commit
a7d358a288
2 changed files with 12 additions and 0 deletions
|
@ -46,6 +46,17 @@ namespace ExCmds {
|
|||
browser.tabs.update(id,{active:true})
|
||||
}
|
||||
|
||||
export function closetabs(ids: number[]){
|
||||
browser.tabs.remove(ids)
|
||||
}
|
||||
|
||||
export async function tabclose(n = 1){
|
||||
let filtTabs = await browser.tabs.query({active: true})
|
||||
let activeTabID = filtTabs[0].id
|
||||
// TODO: work out what the ids of the next n tabs are and close them also
|
||||
closetabs([activeTabID])
|
||||
}
|
||||
|
||||
/** Switch to the next tab by index (position on tab bar), wrapping round.
|
||||
|
||||
optional increment is number of tabs forwards to move.
|
||||
|
|
|
@ -14,6 +14,7 @@ namespace Parsing {
|
|||
["j", "scrolldownline"],
|
||||
["H", "historyback"],
|
||||
["L", "historyforward"],
|
||||
["d", "tabclose"],
|
||||
["k", "scrollupline"],
|
||||
["gt", "tabnext"],
|
||||
["gT", "tabprev"],
|
||||
|
|
Loading…
Add table
Reference in a new issue