-
Notifications
You must be signed in to change notification settings - Fork 853
Expand file tree
/
Copy pathfirefox.py
More file actions
67 lines (56 loc) · 1.5 KB
/
firefox.py
File metadata and controls
67 lines (56 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
from talon import Context, Module, actions
ctx = Context()
mod = Module()
apps = mod.apps
apps.firefox = "app.name: Firefox"
apps.firefox = "app.name: Firefox Developer Edition"
apps.firefox = "app.name: firefox"
apps.firefox = "app.name: org.mozilla.firefox"
apps.firefox = "app.name: Firefox-esr"
apps.firefox = "app.name: firefox-esr"
apps.firefox = "app.name: LibreWolf"
apps.firefox = "app.name: waterfox"
apps.firefox = "app.name: Waterfox"
apps.firefox = r"""
os: windows
and app.name: Firefox
os: windows
and app.exe: /^firefox\.exe$/i
"""
apps.firefox = """
os: mac
and app.bundle: org.mozilla.firefox
"""
apps.firefox = """
os: mac
and app.bundle: net.waterfox.waterfox
"""
# Make the context match more specifically than anything else. This is important, eg. to
# override the browser.go_home() implementation in tags/browser/browser_mac.py.
ctx.matches = r"""
os: windows
os: linux
os: mac
tag: browser
app: firefox
"""
@mod.action_class
class Actions:
def firefox_bookmarks_sidebar():
"""Toggles the Firefox bookmark sidebar"""
def firefox_history_sidebar():
"""Toggles the Firefox history sidebar"""
@ctx.action_class("user")
class UserActions:
def tab_close_wrapper():
actions.sleep("180ms")
actions.app.tab_close()
@ctx.action_class("browser")
class BrowserActions:
def focus_page():
actions.browser.focus_address()
actions.edit.find()
actions.sleep("180ms")
actions.key("escape")
def go_home():
actions.key("alt-home")