mirror of
https://github.com/vale981/tridactyl
synced 2025-03-05 09:31:41 -05:00
Add reload commands
I also made getnexttabs asynchronous, because I suspect it will have to be, eventually.
This commit is contained in:
parent
b468747333
commit
861a0aae03
2 changed files with 15 additions and 2 deletions
|
@ -43,7 +43,7 @@ namespace ExCmds {
|
|||
// Tab functions
|
||||
|
||||
// TODO: to be implemented!
|
||||
export function getnexttabs(tabid: number, n: number){
|
||||
export async function getnexttabs(tabid: number, n: number){
|
||||
return [tabid]
|
||||
}
|
||||
|
||||
|
@ -61,9 +61,20 @@ namespace ExCmds {
|
|||
|
||||
export async function tabclose(n = 1){
|
||||
let activeTabID = await getactivetabid()
|
||||
closetabs(getnexttabs(activeTabID,n))
|
||||
closetabs(await getnexttabs(activeTabID,n))
|
||||
}
|
||||
|
||||
export async function reload(n = 1, hard = false){
|
||||
let tabstoreload = await getnexttabs(await getactivetabid(),n)
|
||||
let reloadProperties = {bypassCache: hard}
|
||||
tabstoreload.map(
|
||||
(n)=>browser.tabs.reload(n, reloadProperties)
|
||||
)
|
||||
}
|
||||
|
||||
export async function reloadhard(n = 1){
|
||||
reload(n, true)
|
||||
}
|
||||
|
||||
/** Switch to the next tab by index (position on tab bar), wrapping round.
|
||||
|
||||
|
|
|
@ -15,6 +15,8 @@ namespace Parsing {
|
|||
["H", "historyback"],
|
||||
["L", "historyforward"],
|
||||
["d", "tabclose"],
|
||||
["r", "reload"],
|
||||
["R", "reloadhard"],
|
||||
["k", "scrollupline"],
|
||||
["gt", "tabnext"],
|
||||
["gT", "tabprev"],
|
||||
|
|
Loading…
Add table
Reference in a new issue