Skip to content

Commit

Permalink
Add a small delay to tab close on Chrome (#553)
Browse files Browse the repository at this point in the history
Co-authored-by: Xavier Downs <>
  • Loading branch information
xavier630 authored Aug 11, 2021
1 parent 823b60b commit 8960bba
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions apps/chrome/chrome.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ def tab_final():
else:
actions.key("ctrl-9")

def tab_close_wrapper():
actions.sleep("180ms")
actions.app.tab_close()


@ctx.action_class("browser")
class browser_actions:
Expand Down
4 changes: 4 additions & 0 deletions code/tabs.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ def tab_jump(number: int):

def tab_final():
"""Jumps to the final tab"""

def tab_close_wrapper():
"""Closes the current tab"""
actions.app.tab_close()
2 changes: 1 addition & 1 deletion misc/tabs.talon
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ tag: user.tabs
tab (open | new): app.tab_open()
tab last: app.tab_previous()
tab next: app.tab_next()
tab close: app.tab_close()
tab close: user.tab_close_wrapper()
tab (reopen|restore): app.tab_reopen()
go tab <number>: user.tab_jump(number)
go tab final: user.tab_final()

0 comments on commit 8960bba

Please sign in to comment.