mirror of
https://github.com/vale981/tridactyl
synced 2025-03-06 01:51:40 -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
|
// Tab functions
|
||||||
|
|
||||||
// TODO: to be implemented!
|
// TODO: to be implemented!
|
||||||
export function getnexttabs(tabid: number, n: number){
|
export async function getnexttabs(tabid: number, n: number){
|
||||||
return [tabid]
|
return [tabid]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,9 +61,20 @@ namespace ExCmds {
|
||||||
|
|
||||||
export async function tabclose(n = 1){
|
export async function tabclose(n = 1){
|
||||||
let activeTabID = await getactivetabid()
|
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.
|
/** Switch to the next tab by index (position on tab bar), wrapping round.
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,8 @@ namespace Parsing {
|
||||||
["H", "historyback"],
|
["H", "historyback"],
|
||||||
["L", "historyforward"],
|
["L", "historyforward"],
|
||||||
["d", "tabclose"],
|
["d", "tabclose"],
|
||||||
|
["r", "reload"],
|
||||||
|
["R", "reloadhard"],
|
||||||
["k", "scrollupline"],
|
["k", "scrollupline"],
|
||||||
["gt", "tabnext"],
|
["gt", "tabnext"],
|
||||||
["gT", "tabprev"],
|
["gT", "tabprev"],
|
||||||
|
|
Loading…
Add table
Reference in a new issue