hotkey-router 0.5.2 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,644 +1,15 @@
1
- // hotkey-router v0.5.2 | SEE LICENSE IN LICENSE
1
+ // hotkey-router v0.6.0 | SEE LICENSE IN LICENSE
2
2
 
3
3
 
4
- // lookup.js
5
- function ownValue(table, key) {
6
- return table != null && Object.prototype.hasOwnProperty.call(table, key) ? table[key] : void 0;
7
- }
4
+ // reservations.js
5
+ import { ownValue } from "./lookup.js";
8
6
 
9
7
  // data/browser-hotkeys.json
10
- var browser_hotkeys_default = {
11
- $comment: "Machine-readable companion to docs/browser-hotkeys.md. Each combo entry describes who claims the binding and how strongly. Intended for runtime conflict warnings in keyboard-routing libraries (e.g. hotkey-router) and dev-time validation in apps like WebRadar. Update both this file and the markdown together \u2014 the markdown is the human source of truth, this file is the machine projection.",
12
- version: {
13
- generated: "2026-10-29",
14
- schema: "1.0",
15
- sources: [
16
- "https://support.mozilla.org/en-US/kb/keyboard-shortcuts-perform-firefox-tasks-quickly",
17
- "https://firefox-source-docs.mozilla.org/devtools-user/keyboard_shortcuts/index.html",
18
- "https://support.google.com/chrome/answer/157179",
19
- "https://developer.chrome.com/docs/devtools/shortcuts",
20
- "https://support.apple.com/guide/safari/keyboard-shortcuts-and-gestures-cpsh003/mac",
21
- "https://developer.apple.com/documentation/safari-developer-tools/web-inspector",
22
- "https://support.microsoft.com/en-us/microsoft-edge/keyboard-shortcuts-in-microsoft-edge-50d3edab-30d9-c7e4-21ce-37fe2713cfad",
23
- "https://support.apple.com/en-us/102650",
24
- "https://support.microsoft.com/en-us/windows/keyboard-shortcuts-in-windows-dcc61a57-8ff0-cffe-9796-cb9706c75eec",
25
- "https://help.gnome.org/gnome-help/shell-keyboard-shortcuts.html"
26
- ]
27
- },
28
- severityLevels: {
29
- hard: "Browser or OS intercepts before page-world keydown fires. preventDefault() can't recover it.",
30
- "find-bar-only": "Reserved only when the browser's find bar has focus. Fires in page world during normal browsing.",
31
- "menu-activation": "Win/Linux Alt+letter activates the browser menu bar. Hard to suppress reliably.",
32
- "system-text": "Only reserved while a text input has focus (terminal-style cursor controls on macOS).",
33
- compose: "macOS Option+letter types a special character in text inputs. Outside inputs, free for page world.",
34
- os: "Operating system intercepts globally, before any application sees it.",
35
- "devtools-open": "Only relevant when DevTools is already open; outside DevTools it fires normally.",
36
- preventable: "The browser's own shortcut, but keydown reaches the page first: a binding with preventDefault() keeps the browser out, and without one the browser acts. Checked with real keys on Windows (docs/notes/key-check-reserved-2026-10-29.md)."
37
- },
38
- $keyFormat: "Each combo key uses hotkey-router-compatible syntax: modifiers in canonical order (ctrl|meta|alt|shift) joined by '+', then the key (lowercased letter, or symbolic name). Per-platform tables use the platform's native modifier name \u2014 `meta` on macOS = Cmd, `meta` on Windows = Win, `ctrl` on Linux/Windows = the primary modifier.",
39
- platforms: {
40
- mac: {
41
- browsers: {
42
- firefox: {
43
- "meta+a": { action: "Select all", severity: "hard" },
44
- "meta+b": { action: "Bookmarks sidebar", severity: "hard" },
45
- "meta+c": { action: "Copy", severity: "hard" },
46
- "meta+d": { action: "Bookmark this page", severity: "hard" },
47
- "meta+e": { action: "Search from page", severity: "hard" },
48
- "meta+f": { action: "Find in page", severity: "hard" },
49
- "meta+g": { action: "Find next", severity: "hard" },
50
- "meta+j": { action: "Downloads", severity: "hard" },
51
- "meta+l": { action: "Focus address bar", severity: "hard" },
52
- "meta+n": { action: "New window", severity: "hard" },
53
- "meta+o": { action: "Open file", severity: "hard" },
54
- "meta+p": { action: "Print", severity: "hard" },
55
- "meta+r": { action: "Reload", severity: "hard" },
56
- "meta+s": { action: "Save page", severity: "hard" },
57
- "meta+t": { action: "New tab", severity: "hard" },
58
- "meta+u": { action: "View source", severity: "hard" },
59
- "meta+v": { action: "Paste", severity: "hard" },
60
- "meta+w": { action: "Close tab", severity: "hard" },
61
- "meta+x": { action: "Cut", severity: "hard" },
62
- "meta+y": { action: "Redo", severity: "hard" },
63
- "meta+z": { action: "Undo", severity: "hard" },
64
- "meta+shift+a": { action: "Add-ons manager", severity: "hard" },
65
- "meta+shift+b": { action: "Bookmarks toolbar", severity: "hard" },
66
- "meta+shift+c": { action: "Inspector (element picker)", severity: "hard" },
67
- "meta+shift+d": { action: "Bookmark all tabs", severity: "hard" },
68
- "meta+shift+e": { action: "Network Monitor", severity: "hard" },
69
- "meta+shift+f": { action: "Toggle fullscreen", severity: "hard" },
70
- "meta+shift+g": { action: "Find previous", severity: "find-bar-only" },
71
- "meta+shift+j": { action: "Browser Console", severity: "hard" },
72
- "meta+shift+n": { action: "New private window", severity: "hard" },
73
- "meta+shift+o": { action: "Bookmarks library", severity: "hard" },
74
- "meta+shift+p": { action: "New private window (alt)", severity: "hard" },
75
- "meta+shift+q": { action: "Quit (with confirm)", severity: "hard" },
76
- "meta+shift+s": { action: "Firefox Screenshot", severity: "hard" },
77
- "meta+shift+t": { action: "Reopen closed tab", severity: "hard" },
78
- "meta+shift+v": { action: "Paste as plain text", severity: "hard" },
79
- "meta+shift+w": { action: "Close window", severity: "hard" },
80
- "meta+shift+z": { action: "Redo", severity: "hard" },
81
- "meta+alt+c": { action: "Inspector", severity: "hard" },
82
- "meta+alt+e": { action: "Network Monitor", severity: "hard" },
83
- "meta+alt+i": { action: "DevTools Toolbox", severity: "hard" },
84
- "meta+alt+j": { action: "Browser Console", severity: "hard" },
85
- "meta+alt+k": { action: "Web Console", severity: "hard" },
86
- "meta+alt+m": { action: "Responsive Design Mode", severity: "hard" },
87
- "meta+alt+z": { action: "Debugger", severity: "hard" }
88
- },
89
- chrome: {
90
- "meta+a": { action: "Select all", severity: "hard" },
91
- "meta+c": { action: "Copy", severity: "hard" },
92
- "meta+d": { action: "Bookmark this page", severity: "hard" },
93
- "meta+e": { action: "Search selected text", severity: "find-bar-only" },
94
- "meta+f": { action: "Find in page", severity: "hard" },
95
- "meta+g": { action: "Find next", severity: "hard" },
96
- "meta+l": { action: "Focus address bar", severity: "hard" },
97
- "meta+n": { action: "New window", severity: "hard" },
98
- "meta+o": { action: "Open file", severity: "hard" },
99
- "meta+p": { action: "Print", severity: "hard" },
100
- "meta+r": { action: "Reload", severity: "hard" },
101
- "meta+s": { action: "Save page", severity: "hard" },
102
- "meta+t": { action: "New tab", severity: "hard" },
103
- "meta+v": { action: "Paste", severity: "hard" },
104
- "meta+w": { action: "Close tab", severity: "hard" },
105
- "meta+x": { action: "Cut", severity: "hard" },
106
- "meta+y": { action: "History page", severity: "hard" },
107
- "meta+z": { action: "Undo", severity: "hard" },
108
- "meta+shift+b": { action: "Bookmarks bar toggle", severity: "hard" },
109
- "meta+shift+c": { action: "DevTools Inspector", severity: "hard" },
110
- "meta+shift+d": { action: "Bookmark all tabs", severity: "hard" },
111
- "meta+shift+g": { action: "Find previous", severity: "find-bar-only" },
112
- "meta+shift+j": { action: "Downloads page", severity: "hard" },
113
- "meta+shift+m": { action: "Switch user / guest", severity: "hard" },
114
- "meta+shift+n": { action: "New incognito window", severity: "hard" },
115
- "meta+shift+r": { action: "Hard reload", severity: "hard" },
116
- "meta+shift+t": { action: "Reopen closed tab", severity: "hard" },
117
- "meta+shift+v": { action: "Paste as plain text", severity: "hard" },
118
- "meta+shift+w": { action: "Close window", severity: "hard" },
119
- "meta+shift+z": { action: "Redo", severity: "hard" },
120
- "meta+alt+i": { action: "DevTools", severity: "hard" },
121
- "meta+alt+j": { action: "DevTools (console)", severity: "hard" },
122
- "meta+alt+u": { action: "View source", severity: "hard" }
123
- },
124
- safari: {
125
- "meta+a": { action: "Select all", severity: "hard" },
126
- "meta+c": { action: "Copy", severity: "hard" },
127
- "meta+d": { action: "Add to Reading List", severity: "hard" },
128
- "meta+f": { action: "Find in page", severity: "hard" },
129
- "meta+g": { action: "Find next", severity: "hard" },
130
- "meta+j": { action: "Downloads", severity: "hard" },
131
- "meta+l": { action: "Focus Smart Search", severity: "hard" },
132
- "meta+n": { action: "New window", severity: "hard" },
133
- "meta+p": { action: "Print", severity: "hard" },
134
- "meta+r": { action: "Reload", severity: "hard" },
135
- "meta+s": { action: "Save page", severity: "hard" },
136
- "meta+t": { action: "New tab", severity: "hard" },
137
- "meta+v": { action: "Paste", severity: "hard" },
138
- "meta+w": { action: "Close tab", severity: "hard" },
139
- "meta+x": { action: "Cut", severity: "hard" },
140
- "meta+z": { action: "Undo", severity: "hard" },
141
- "meta+shift+c": { action: "Inspector pick element", severity: "hard" },
142
- "meta+shift+d": { action: "Add Reading List item", severity: "hard" },
143
- "meta+shift+g": { action: "Find previous", severity: "find-bar-only" },
144
- "meta+shift+h": { action: "Go to homepage", severity: "hard" },
145
- "meta+shift+n": { action: "New private window", severity: "hard" },
146
- "meta+shift+r": { action: "Reader mode", severity: "hard" },
147
- "meta+shift+t": { action: "Reopen last closed tab", severity: "hard" },
148
- "meta+shift+v": { action: "Paste as plain text", severity: "hard" },
149
- "meta+shift+w": { action: "Close window", severity: "hard" },
150
- "meta+shift+z": { action: "Redo", severity: "hard" },
151
- "meta+alt+c": { action: "Web Inspector pick", severity: "hard" },
152
- "meta+alt+i": { action: "Web Inspector", severity: "hard" }
153
- },
154
- edge: {
155
- $comment: "From Microsoft's Edge shortcuts page (Mac table), 2026-11-15. Edit-menu rows (meta+a/c/v/x/z, meta+shift+z) as Chrome. Not checked with real keys.",
156
- "meta+a": { action: "Select all", severity: "hard" },
157
- "meta+c": { action: "Copy", severity: "hard" },
158
- "meta+d": { action: "Save as favorite", severity: "hard" },
159
- "meta+f": { action: "Find in page", severity: "hard" },
160
- "meta+g": { action: "Find next", severity: "hard" },
161
- "meta+l": { action: "Focus address bar", severity: "hard" },
162
- "meta+n": { action: "New window", severity: "hard" },
163
- "meta+o": { action: "Open file", severity: "hard" },
164
- "meta+p": { action: "Print", severity: "hard" },
165
- "meta+r": { action: "Reload", severity: "hard" },
166
- "meta+s": { action: "Save page", severity: "hard" },
167
- "meta+t": { action: "New tab", severity: "hard" },
168
- "meta+v": { action: "Paste", severity: "hard" },
169
- "meta+w": { action: "Close tab", severity: "hard" },
170
- "meta+x": { action: "Cut", severity: "hard" },
171
- "meta+y": { action: "History", severity: "hard" },
172
- "meta+z": { action: "Undo", severity: "hard" },
173
- "ctrl+m": { action: "Mute current tab", severity: "hard" },
174
- "ctrl+meta+f": { action: "Toggle full screen", severity: "hard" },
175
- "meta+shift+b": { action: "Favorites bar toggle", severity: "hard" },
176
- "meta+shift+c": { action: "Developer tools", severity: "hard" },
177
- "meta+shift+d": { action: "Favorite all tabs", severity: "hard" },
178
- "meta+shift+e": { action: "Search in sidebar", severity: "hard" },
179
- "meta+shift+g": { action: "Find previous", severity: "find-bar-only" },
180
- "meta+shift+h": { action: "Home page", severity: "hard" },
181
- "meta+shift+m": { action: "Switch user / guest", severity: "hard" },
182
- "meta+shift+n": { action: "New InPrivate window", severity: "hard" },
183
- "meta+shift+r": { action: "Hard reload", severity: "hard" },
184
- "meta+shift+t": { action: "Reopen closed tab", severity: "hard" },
185
- "meta+shift+u": { action: "Read Aloud toggle", severity: "hard" },
186
- "meta+shift+v": { action: "Paste as plain text", severity: "hard" },
187
- "meta+shift+w": { action: "Close window", severity: "hard" },
188
- "meta+shift+z": { action: "Redo", severity: "hard" },
189
- "meta+alt+f": { action: "Search the web", severity: "hard" },
190
- "meta+alt+j": { action: "JavaScript console", severity: "hard" },
191
- "meta+alt+l": { action: "Downloads", severity: "hard" },
192
- "meta+alt+m": { action: "Minimize all windows", severity: "hard" }
193
- }
194
- },
195
- system: {
196
- "meta+space": { action: "Spotlight", severity: "os" },
197
- "meta+tab": { action: "App switcher", severity: "os" },
198
- "meta+h": { action: "Hide app", severity: "os" },
199
- "meta+m": { action: "Minimize window", severity: "os" },
200
- "meta+q": { action: "Quit app", severity: "os" },
201
- "meta+shift+3": { action: "Screenshot full screen", severity: "os" },
202
- "meta+shift+4": { action: "Screenshot selection", severity: "os" },
203
- "meta+shift+5": { action: "Screen recording tool", severity: "os" },
204
- "meta+shift+q": { action: "Log out", severity: "os" },
205
- "meta+ctrl+q": { action: "Lock screen", severity: "os" },
206
- "meta+ctrl+space": { action: "Character Viewer", severity: "os" },
207
- "meta+alt+esc": { action: "Force-quit dialog", severity: "os" },
208
- "meta+shift+slash": { action: "Help menu search (Cmd+?)", severity: "os" },
209
- "meta+alt+h": { action: "Hide other apps", severity: "os" },
210
- "meta+alt+d": { action: "Show or hide the Dock", severity: "os" },
211
- "meta+backquote": { action: "Switch windows of the front app", severity: "os" }
212
- },
213
- noteForLetterCombos: {
214
- "alt+a..z": { behavior: "compose", note: "Option+letter types special characters in text inputs (Option+E\u2192\xB4, Option+A\u2192\xE5, Option+F\u2192\u0192). Outside inputs, free for page world." },
215
- "ctrl+a..z": { behavior: "system-text", note: "Mac uses Ctrl+letter as terminal-style cursor controls inside text inputs (Ctrl+A=line start, Ctrl+E=line end, Ctrl+K=delete-to-end, etc.). Outside inputs, free for page world." }
216
- }
217
- },
218
- windows: {
219
- browsers: {
220
- firefox: {
221
- "ctrl+a": { action: "Select all", severity: "preventable" },
222
- "ctrl+b": { action: "Bookmarks sidebar", severity: "preventable" },
223
- "ctrl+c": { action: "Copy", severity: "preventable" },
224
- "ctrl+d": { action: "Bookmark this page", severity: "preventable" },
225
- "ctrl+e": { action: "Search from page", severity: "preventable" },
226
- "ctrl+f": { action: "Find in page", severity: "preventable" },
227
- "ctrl+g": { action: "Find next", severity: "preventable" },
228
- "ctrl+h": { action: "History sidebar", severity: "preventable" },
229
- "ctrl+j": { action: "Downloads", severity: "preventable" },
230
- "ctrl+k": { action: "Search from page", severity: "preventable" },
231
- "ctrl+l": { action: "Focus address bar", severity: "preventable" },
232
- "ctrl+n": { action: "New window", severity: "hard" },
233
- "ctrl+o": { action: "Open file", severity: "preventable" },
234
- "ctrl+p": { action: "Print", severity: "preventable" },
235
- "ctrl+r": { action: "Reload", severity: "preventable" },
236
- "ctrl+s": { action: "Save page", severity: "preventable" },
237
- "ctrl+t": { action: "New tab", severity: "hard" },
238
- "ctrl+u": { action: "View source", severity: "preventable" },
239
- "ctrl+v": { action: "Paste", severity: "preventable" },
240
- "ctrl+w": { action: "Close tab", severity: "hard" },
241
- "ctrl+x": { action: "Cut", severity: "preventable" },
242
- "ctrl+y": { action: "Redo", severity: "preventable" },
243
- "ctrl+z": { action: "Undo", severity: "preventable" },
244
- "ctrl+shift+a": { action: "Add-ons manager", severity: "hard" },
245
- "ctrl+shift+b": { action: "Bookmarks toolbar", severity: "hard" },
246
- "ctrl+shift+c": { action: "Inspector (element picker)", severity: "hard" },
247
- "ctrl+shift+d": { action: "Bookmark all tabs", severity: "hard" },
248
- "ctrl+shift+e": { action: "Network Monitor", severity: "hard" },
249
- "ctrl+shift+g": { action: "Find previous", severity: "find-bar-only" },
250
- "ctrl+shift+i": { action: "Developer Tools", severity: "hard" },
251
- "ctrl+shift+j": { action: "Browser Console", severity: "hard" },
252
- "ctrl+shift+k": { action: "Web Console", severity: "hard" },
253
- "ctrl+shift+m": { action: "Responsive Design Mode", severity: "hard" },
254
- "ctrl+shift+n": { action: "New private window", severity: "hard" },
255
- "ctrl+shift+o": { action: "Bookmarks library", severity: "hard" },
256
- "ctrl+shift+p": { action: "New private window (alt)", severity: "hard" },
257
- "ctrl+shift+s": { action: "Firefox Screenshot", severity: "hard" },
258
- "ctrl+shift+t": { action: "Reopen closed tab", severity: "hard" },
259
- "ctrl+shift+v": { action: "Paste as plain text", severity: "hard" },
260
- "ctrl+shift+w": { action: "Close window", severity: "hard" },
261
- "ctrl+shift+y": { action: "Downloads (alt)", severity: "hard" },
262
- "ctrl+shift+z": { action: "Debugger", severity: "hard" },
263
- "alt+f": { action: "File menu", severity: "menu-activation" },
264
- "alt+e": { action: "Edit menu", severity: "menu-activation" },
265
- "alt+v": { action: "View menu", severity: "menu-activation" },
266
- "alt+b": { action: "Bookmarks menu", severity: "menu-activation" },
267
- "alt+t": { action: "Tools menu", severity: "menu-activation" },
268
- "alt+h": { action: "Help menu", severity: "menu-activation" },
269
- "alt+d": { action: "Focus address bar", severity: "hard" }
270
- },
271
- chrome: {
272
- "ctrl+a": { action: "Select all", severity: "preventable" },
273
- "ctrl+c": { action: "Copy", severity: "preventable" },
274
- "ctrl+d": { action: "Bookmark this page", severity: "preventable" },
275
- "ctrl+e": { action: "Search from page", severity: "preventable" },
276
- "ctrl+f": { action: "Find in page", severity: "preventable" },
277
- "ctrl+g": { action: "Find next", severity: "preventable" },
278
- "ctrl+h": { action: "History page", severity: "preventable" },
279
- "ctrl+j": { action: "Downloads", severity: "preventable" },
280
- "ctrl+k": { action: "Search from page", severity: "preventable" },
281
- "ctrl+l": { action: "Focus address bar", severity: "preventable" },
282
- "ctrl+n": { action: "New window", severity: "hard" },
283
- "ctrl+o": { action: "Open file", severity: "preventable" },
284
- "ctrl+p": { action: "Print", severity: "preventable" },
285
- "ctrl+r": { action: "Reload", severity: "preventable" },
286
- "ctrl+s": { action: "Save page", severity: "preventable" },
287
- "ctrl+t": { action: "New tab", severity: "hard" },
288
- "ctrl+u": { action: "View source", severity: "preventable" },
289
- "ctrl+v": { action: "Paste", severity: "preventable" },
290
- "ctrl+w": { action: "Close tab", severity: "hard" },
291
- "ctrl+x": { action: "Cut", severity: "preventable" },
292
- "ctrl+z": { action: "Undo", severity: "preventable" },
293
- "ctrl+shift+b": { action: "Bookmarks bar toggle", severity: "hard" },
294
- "ctrl+shift+d": { action: "Bookmark all tabs", severity: "hard" },
295
- "ctrl+shift+g": { action: "Find previous", severity: "find-bar-only" },
296
- "ctrl+shift+i": { action: "DevTools", severity: "hard" },
297
- "ctrl+shift+j": { action: "DevTools (console)", severity: "hard" },
298
- "ctrl+shift+m": { action: "Switch user / guest", severity: "hard" },
299
- "ctrl+shift+n": { action: "Incognito window", severity: "hard" },
300
- "ctrl+shift+r": { action: "Hard reload", severity: "hard" },
301
- "ctrl+shift+t": { action: "Reopen closed tab", severity: "hard" },
302
- "ctrl+shift+v": { action: "Paste as plain text", severity: "hard" },
303
- "ctrl+shift+w": { action: "Close window", severity: "hard" },
304
- "alt+d": { action: "Focus address bar", severity: "hard" },
305
- "alt+e": { action: "Customize menu", severity: "menu-activation" },
306
- "alt+f": { action: "Customize menu (alt)", severity: "menu-activation" }
307
- },
308
- edge: {
309
- "ctrl+a": { action: "Select all", severity: "preventable" },
310
- "ctrl+c": { action: "Copy", severity: "preventable" },
311
- "ctrl+d": { action: "Favorite this page", severity: "preventable" },
312
- "ctrl+e": { action: "Search from page", severity: "preventable" },
313
- "ctrl+f": { action: "Find in page", severity: "preventable" },
314
- "ctrl+g": { action: "Find next", severity: "preventable" },
315
- "ctrl+h": { action: "History", severity: "preventable" },
316
- "ctrl+j": { action: "Downloads", severity: "preventable" },
317
- "ctrl+k": { action: "Search from page", severity: "preventable" },
318
- "ctrl+l": { action: "Focus address bar", severity: "preventable" },
319
- "ctrl+m": { action: "Mute current tab", severity: "preventable" },
320
- "ctrl+n": { action: "New window", severity: "hard" },
321
- "ctrl+o": { action: "Open file", severity: "preventable" },
322
- "ctrl+p": { action: "Print", severity: "preventable" },
323
- "ctrl+r": { action: "Reload", severity: "preventable" },
324
- "ctrl+s": { action: "Save page", severity: "preventable" },
325
- "ctrl+t": { action: "New tab", severity: "hard" },
326
- "ctrl+u": { action: "View source", severity: "preventable" },
327
- "ctrl+v": { action: "Paste", severity: "preventable" },
328
- "ctrl+w": { action: "Close tab", severity: "hard" },
329
- "ctrl+x": { action: "Cut", severity: "preventable" },
330
- "ctrl+z": { action: "Undo", severity: "preventable" },
331
- "ctrl+shift+b": { action: "Favorites bar toggle", severity: "hard" },
332
- "ctrl+shift+d": { action: "Bookmark all tabs in folder", severity: "hard" },
333
- "ctrl+shift+e": { action: "Search in sidebar", severity: "hard" },
334
- "ctrl+shift+g": { action: "Find previous", severity: "find-bar-only" },
335
- "ctrl+shift+i": { action: "DevTools", severity: "hard" },
336
- "ctrl+shift+j": { action: "DevTools (console)", severity: "hard" },
337
- "ctrl+shift+k": { action: "Duplicate tab", severity: "hard" },
338
- "ctrl+shift+l": { action: "Paste and search", severity: "hard" },
339
- "ctrl+shift+m": { action: "Switch user / guest", severity: "hard" },
340
- "ctrl+shift+n": { action: "InPrivate window", severity: "hard" },
341
- "ctrl+shift+o": { action: "Open favorites", severity: "hard" },
342
- "ctrl+shift+p": { action: "Print (system dialog)", severity: "hard" },
343
- "ctrl+shift+r": { action: "Hard reload", severity: "hard" },
344
- "ctrl+shift+t": { action: "Reopen closed tab", severity: "hard" },
345
- "ctrl+shift+u": { action: "Read Aloud toggle", severity: "hard" },
346
- "ctrl+shift+v": { action: "Paste without formatting", severity: "hard" },
347
- "ctrl+shift+w": { action: "Close window", severity: "hard" },
348
- "ctrl+shift+y": { action: "Collections", severity: "hard" },
349
- "alt+d": { action: "Focus address bar", severity: "hard" },
350
- "alt+e": { action: "Settings menu", severity: "menu-activation" },
351
- "alt+f": { action: "Settings menu (alt)", severity: "menu-activation" },
352
- "alt+shift+b": { action: "Focus favorites bar", severity: "hard" },
353
- "alt+shift+i": { action: "Send feedback dialog", severity: "hard" },
354
- "alt+shift+t": { action: "Focus app bar toolbar", severity: "hard" }
355
- }
356
- },
357
- system: {
358
- "meta+a": { action: "Action Center", severity: "os" },
359
- "meta+c": { action: "Windows search", severity: "os" },
360
- "meta+d": { action: "Show desktop", severity: "os" },
361
- "meta+e": { action: "File Explorer", severity: "os" },
362
- "meta+g": { action: "Game bar", severity: "os" },
363
- "meta+h": { action: "Voice dictation", severity: "os" },
364
- "meta+i": { action: "Settings", severity: "os" },
365
- "meta+l": { action: "Lock", severity: "os" },
366
- "meta+n": { action: "Notification center", severity: "os" },
367
- "meta+p": { action: "Project / display mode", severity: "os" },
368
- "meta+r": { action: "Run dialog", severity: "os" },
369
- "meta+s": { action: "Search", severity: "os" },
370
- "meta+v": { action: "Clipboard history", severity: "os" },
371
- "meta+w": { action: "Widgets", severity: "os" },
372
- "meta+x": { action: "Quick Link menu", severity: "os" },
373
- "meta+z": { action: "Snap layouts", severity: "os" },
374
- "meta+tab": { action: "Task View", severity: "os" },
375
- "meta+shift+s": { action: "Screenshot region", severity: "os" },
376
- "ctrl+shift+esc": { action: "Task Manager", severity: "os" },
377
- "ctrl+alt+del": { action: "Security screen", severity: "os" },
378
- "alt+tab": { action: "Switch windows", severity: "os" },
379
- "alt+f4": { action: "Close active window", severity: "os" }
380
- }
381
- },
382
- linux: {
383
- browsers: {
384
- firefox: "$ref:platforms.windows.browsers.firefox",
385
- chrome: "$ref:platforms.windows.browsers.chrome",
386
- edge: "$ref:platforms.windows.browsers.edge"
387
- },
388
- system: {
389
- $comment: "GNOME defaults. KDE and other DEs have similar-shaped reservations but vary; this is a conservative baseline.",
390
- "meta+tab": { action: "Switch windows", severity: "os" },
391
- "meta+a": { action: "Show applications", severity: "os" },
392
- "meta+l": { action: "Lock screen", severity: "os" },
393
- "meta+v": { action: "Notification list", severity: "os" },
394
- "alt+tab": { action: "Switch applications", severity: "os" },
395
- "alt+esc": { action: "Cycle windows", severity: "os" },
396
- "alt+f2": { action: "Run command", severity: "os" },
397
- "alt+f4": { action: "Close window", severity: "os" },
398
- "ctrl+alt+tab": { action: "Top-bar accessibility switcher", severity: "os" },
399
- "ctrl+alt+del": { action: "Power-off dialog", severity: "os" },
400
- "ctrl+shift+alt+r": { action: "Toggle screencast recording", severity: "os" }
401
- },
402
- noteForCtrlAlt: "Some Linux setups map right-Alt (AltGr) to 'compose' for typing accented characters, in which case AltGr+letter is reported as ctrl+alt+letter and types a special character. Avoid the ctrl+alt+letter namespace on Linux."
403
- }
404
- }
405
- };
406
-
407
- // platform.js
408
- function fromPlatformString(s) {
409
- if (!s) return null;
410
- if (/Chrome ?OS|CrOS/i.test(s)) return "chromeos";
411
- if (/Mac|iPhone|iPad|iPod/i.test(s)) return "mac";
412
- if (/Win/i.test(s)) return "windows";
413
- if (/Linux|X11/i.test(s)) return "linux";
414
- return null;
415
- }
416
- function detectPlatform(nav = typeof navigator !== "undefined" ? navigator : null, { chromeos = false } = {}) {
417
- if (!nav) return null;
418
- const ua = nav.userAgent || "";
419
- const found = (/\bCrOS\b/.test(ua) ? "chromeos" : null) || fromPlatformString(nav.userAgentData?.platform) || fromPlatformString(nav.platform) || (/Mac OS X/i.test(ua) ? "mac" : /Windows/i.test(ua) ? "windows" : /Linux|X11/i.test(ua) ? "linux" : null);
420
- if (found === "chromeos" && !chromeos) return "linux";
421
- return found;
422
- }
423
- function detectBrowser(nav = typeof navigator !== "undefined" ? navigator : null) {
424
- if (!nav) return null;
425
- const ua = nav.userAgent || "";
426
- if (/Edg\//.test(ua)) return "edge";
427
- if (/Firefox/.test(ua)) return "firefox";
428
- if (/Chrome/.test(ua)) return "chrome";
429
- if (/Safari/.test(ua)) return "safari";
430
- return null;
431
- }
432
- var PLATFORM_LABELS = { mac: "macOS", windows: "Windows", linux: "Linux", chromeos: "ChromeOS" };
433
- function platformLabel(platform) {
434
- return ownValue(PLATFORM_LABELS, platform) || platform;
435
- }
436
-
437
- // parse.js
438
- var DEFAULT_PLATFORM = detectPlatform();
439
- var modifierTokens = /* @__PURE__ */ new Set(["ctrl", "shift", "alt", "meta", "mod"]);
440
- var ahkPrefixMap = /* @__PURE__ */ new Map([
441
- ["^", "ctrl"],
442
- // Ctrl
443
- ["!", "alt"],
444
- // Alt
445
- ["+", "shift"],
446
- // Shift
447
- ["#", "meta"]
448
- // Win / Command
449
- ]);
450
- var keyAliases = Object.freeze({
451
- // common
452
- esc: "escape",
453
- escape: "escape",
454
- space: " ",
455
- spacebar: " ",
456
- enter: "enter",
457
- return: "enter",
458
- del: "delete",
459
- delete: "delete",
460
- backspace: "backspace",
461
- tab: "tab",
462
- // arrows
463
- up: "arrowup",
464
- down: "arrowdown",
465
- left: "arrowleft",
466
- right: "arrowright",
467
- // navigation
468
- home: "home",
469
- end: "end",
470
- pageup: "pageup",
471
- pagedown: "pagedown",
472
- pgup: "pageup",
473
- pgdn: "pagedown",
474
- // modifiers (words)
475
- cmd: "meta",
476
- command: "meta",
477
- win: "meta",
478
- meta: "meta",
479
- control: "ctrl",
480
- ctrl: "ctrl",
481
- option: "alt",
482
- opt: "alt",
483
- alt: "alt",
484
- shift: "shift",
485
- // modifiers (symbols)
486
- "\u2318": "meta",
487
- "\u2303": "ctrl",
488
- "\u2325": "alt",
489
- "\u21E7": "shift",
490
- // cross-platform "mod", resolved per platform while parsing
491
- mod: "mod",
492
- // plus key ergonomics
493
- plus: "+"
494
- });
495
- function normalizeKey(key) {
496
- const original = String(key ?? "");
497
- if (original === " ") return " ";
498
- const trimmed = original.trim();
499
- const k = trimmed.toLowerCase();
500
- return ownValue(keyAliases, k) ?? k;
501
- }
502
- function isModifierToken(token) {
503
- return modifierTokens.has(normalizeKey(token));
504
- }
505
- var CODE_TOKEN_RE = /(^|\+)\s*code:([A-Za-z][A-Za-z0-9_]*)/;
506
- function readHotkey(hotkeyStr, { platform = DEFAULT_PLATFORM } = {}) {
507
- const raw = String(hotkeyStr || "").trim();
508
- let error = null;
509
- const fail = (msg) => {
510
- error = error || `Invalid hotkey "${hotkeyStr}": ${msg}`;
511
- };
512
- const isUp = /\s+up$/i.test(raw);
513
- const baseRaw = isUp ? raw.replace(/\s+up$/i, "").trim() : raw;
514
- const combo = {
515
- ctrl: false,
516
- shift: false,
517
- alt: false,
518
- meta: false,
519
- key: null,
520
- code: null,
521
- bareModifier: null
522
- };
523
- const setMod = (mod) => {
524
- if (mod === "mod") combo[platform === "mac" ? "meta" : "ctrl"] = true;
525
- else combo[mod] = true;
526
- };
527
- let stripped = baseRaw;
528
- while (stripped.length > 1) {
529
- const mod = ahkPrefixMap.get(stripped[0]) ?? null;
530
- if (!mod) break;
531
- setMod(mod);
532
- stripped = stripped.slice(1).trimStart();
533
- }
534
- const codeMatches = stripped.match(/code:[A-Za-z][A-Za-z0-9_]*/g);
535
- if (codeMatches && codeMatches.length > 1) {
536
- fail(`multiple code: tokens not supported (got ${codeMatches.length}).`);
537
- }
538
- let codeValue = null;
539
- const scrubbed = stripped.replace(CODE_TOKEN_RE, (_, sep, val) => {
540
- codeValue = val;
541
- return sep + "__code__";
542
- });
543
- const cleanStr = scrubbed.toLowerCase();
544
- const rawParts = cleanStr.split("+").map((p) => p.trim());
545
- const parts = rawParts.filter(Boolean);
546
- const impliedPlusKey = rawParts.some((p) => p === "") && cleanStr.includes("++");
547
- if (!impliedPlusKey) {
548
- let seenBase = false;
549
- for (const part of parts) {
550
- if (isModifierToken(part)) {
551
- if (seenBase) fail('modifiers must come before the base key (e.g. "ctrl+k", not "k+ctrl")');
552
- } else {
553
- seenBase = true;
554
- }
555
- }
556
- }
557
- let bases = 0;
558
- for (const part of parts) {
559
- if (part === "__code__") {
560
- combo.code = codeValue;
561
- bases++;
562
- continue;
563
- }
564
- const actual = ownValue(keyAliases, part) ?? part;
565
- if (modifierTokens.has(actual)) setMod(actual);
566
- else {
567
- combo.key = normalizeKey(actual);
568
- bases++;
569
- }
570
- }
571
- if (bases > 1) fail('use one base key (e.g. "ctrl+k"), or one code: token');
572
- if (!combo.key && !combo.code && (impliedPlusKey || stripped === "+")) combo.key = "+";
573
- if (!combo.key && !combo.code) {
574
- const modCount = (combo.ctrl ? 1 : 0) + (combo.shift ? 1 : 0) + (combo.alt ? 1 : 0) + (combo.meta ? 1 : 0);
575
- if (modCount === 1) {
576
- combo.bareModifier = combo.ctrl ? "ctrl" : combo.shift ? "shift" : combo.alt ? "alt" : "meta";
577
- } else if (modCount > 1) {
578
- fail('multi-modifier bare bindings not supported. Add a base key (e.g. "ctrl+alt+x").');
579
- } else {
580
- error = error || `Invalid hotkey "${hotkeyStr}" (missing base key)`;
581
- }
582
- }
583
- return { combo, type: isUp ? "keyup" : "keydown", raw: hotkeyStr, error };
584
- }
585
- var SHIFTED_PUNCT = {
586
- ",": ["<", "Comma"],
587
- ".": [">", "Period"],
588
- "/": ["?", "Slash"],
589
- ";": [":", "Semicolon"],
590
- "'": ['"', "Quote"],
591
- "[": ["{", "BracketLeft"],
592
- "]": ["}", "BracketRight"],
593
- "\\": ["|", "Backslash"],
594
- "-": ["_", "Minus"],
595
- "=": ["+", "Equal"],
596
- "`": ["~", "Backquote"]
597
- };
598
- for (let d = 0; d < 10; d++) SHIFTED_PUNCT[d] = [")!@#$%^&*("[d], "Digit" + d];
599
- var PUNCT_NAMES = {
600
- ".": "period",
601
- ",": "comma",
602
- ";": "semicolon",
603
- "'": "quote",
604
- "/": "slash",
605
- "\\": "backslash",
606
- "[": "bracketleft",
607
- "]": "bracketright",
608
- "-": "minus",
609
- "=": "equal",
610
- "`": "backquote",
611
- " ": "space",
612
- "+": "equal"
613
- };
614
- function codeToBase(code) {
615
- if (!code) return null;
616
- const letter = /^Key([A-Za-z])$/.exec(code);
617
- if (letter) return letter[1].toLowerCase();
618
- const digit = /^(?:Digit|Numpad)(\d)$/.exec(code);
619
- if (digit) return digit[1];
620
- return code.toLowerCase();
621
- }
622
- function keyToBase(key) {
623
- if (key == null || key === "") return null;
624
- if (ownValue(PUNCT_NAMES, key)) return ownValue(PUNCT_NAMES, key);
625
- const k = normalizeKey(key);
626
- return ownValue(PUNCT_NAMES, k) || k || null;
627
- }
628
- function lookupKey(combo) {
629
- if (!combo || combo.bareModifier) return null;
630
- const base = combo.code ? codeToBase(combo.code) : keyToBase(combo.key);
631
- if (!base) return null;
632
- const parts = [];
633
- if (combo.ctrl) parts.push("ctrl");
634
- if (combo.meta) parts.push("meta");
635
- if (combo.alt) parts.push("alt");
636
- if (combo.shift) parts.push("shift");
637
- parts.push(base);
638
- return parts.join("+");
639
- }
8
+ var browser_hotkeys_default = { version: { generated: "2026-10-29", schema: "1.0" }, platforms: { mac: { browsers: { firefox: { "meta+a": { action: "Select all", severity: "hard" }, "meta+b": { action: "Bookmarks sidebar", severity: "hard" }, "meta+c": { action: "Copy", severity: "hard" }, "meta+d": { action: "Bookmark this page", severity: "hard" }, "meta+e": { action: "Search from page", severity: "hard" }, "meta+f": { action: "Find in page", severity: "hard" }, "meta+g": { action: "Find next", severity: "hard" }, "meta+j": { action: "Downloads", severity: "hard" }, "meta+l": { action: "Focus address bar", severity: "hard" }, "meta+n": { action: "New window", severity: "hard" }, "meta+o": { action: "Open file", severity: "hard" }, "meta+p": { action: "Print", severity: "hard" }, "meta+r": { action: "Reload", severity: "hard" }, "meta+s": { action: "Save page", severity: "hard" }, "meta+t": { action: "New tab", severity: "hard" }, "meta+u": { action: "View source", severity: "hard" }, "meta+v": { action: "Paste", severity: "hard" }, "meta+w": { action: "Close tab", severity: "hard" }, "meta+x": { action: "Cut", severity: "hard" }, "meta+y": { action: "Redo", severity: "hard" }, "meta+z": { action: "Undo", severity: "hard" }, "meta+shift+a": { action: "Add-ons manager", severity: "hard" }, "meta+shift+b": { action: "Bookmarks toolbar", severity: "hard" }, "meta+shift+c": { action: "Inspector (element picker)", severity: "hard" }, "meta+shift+d": { action: "Bookmark all tabs", severity: "hard" }, "meta+shift+e": { action: "Network Monitor", severity: "hard" }, "meta+shift+f": { action: "Toggle fullscreen", severity: "hard" }, "meta+shift+g": { action: "Find previous", severity: "find-bar-only" }, "meta+shift+j": { action: "Browser Console", severity: "hard" }, "meta+shift+n": { action: "New private window", severity: "hard" }, "meta+shift+o": { action: "Bookmarks library", severity: "hard" }, "meta+shift+p": { action: "New private window (alt)", severity: "hard" }, "meta+shift+q": { action: "Quit (with confirm)", severity: "hard" }, "meta+shift+s": { action: "Firefox Screenshot", severity: "hard" }, "meta+shift+t": { action: "Reopen closed tab", severity: "hard" }, "meta+shift+v": { action: "Paste as plain text", severity: "hard" }, "meta+shift+w": { action: "Close window", severity: "hard" }, "meta+shift+z": { action: "Redo", severity: "hard" }, "meta+alt+c": { action: "Inspector", severity: "hard" }, "meta+alt+e": { action: "Network Monitor", severity: "hard" }, "meta+alt+i": { action: "DevTools Toolbox", severity: "hard" }, "meta+alt+j": { action: "Browser Console", severity: "hard" }, "meta+alt+k": { action: "Web Console", severity: "hard" }, "meta+alt+m": { action: "Responsive Design Mode", severity: "hard" }, "meta+alt+z": { action: "Debugger", severity: "hard" } }, chrome: { "meta+a": { action: "Select all", severity: "hard" }, "meta+c": { action: "Copy", severity: "hard" }, "meta+d": { action: "Bookmark this page", severity: "hard" }, "meta+e": { action: "Search selected text", severity: "find-bar-only" }, "meta+f": { action: "Find in page", severity: "hard" }, "meta+g": { action: "Find next", severity: "hard" }, "meta+l": { action: "Focus address bar", severity: "hard" }, "meta+n": { action: "New window", severity: "hard" }, "meta+o": { action: "Open file", severity: "hard" }, "meta+p": { action: "Print", severity: "hard" }, "meta+r": { action: "Reload", severity: "hard" }, "meta+s": { action: "Save page", severity: "hard" }, "meta+t": { action: "New tab", severity: "hard" }, "meta+v": { action: "Paste", severity: "hard" }, "meta+w": { action: "Close tab", severity: "hard" }, "meta+x": { action: "Cut", severity: "hard" }, "meta+y": { action: "History page", severity: "hard" }, "meta+z": { action: "Undo", severity: "hard" }, "meta+shift+b": { action: "Bookmarks bar toggle", severity: "hard" }, "meta+shift+c": { action: "DevTools Inspector", severity: "hard" }, "meta+shift+d": { action: "Bookmark all tabs", severity: "hard" }, "meta+shift+g": { action: "Find previous", severity: "find-bar-only" }, "meta+shift+j": { action: "Downloads page", severity: "hard" }, "meta+shift+m": { action: "Switch user / guest", severity: "hard" }, "meta+shift+n": { action: "New incognito window", severity: "hard" }, "meta+shift+r": { action: "Hard reload", severity: "hard" }, "meta+shift+t": { action: "Reopen closed tab", severity: "hard" }, "meta+shift+v": { action: "Paste as plain text", severity: "hard" }, "meta+shift+w": { action: "Close window", severity: "hard" }, "meta+shift+z": { action: "Redo", severity: "hard" }, "meta+alt+i": { action: "DevTools", severity: "hard" }, "meta+alt+j": { action: "DevTools (console)", severity: "hard" }, "meta+alt+u": { action: "View source", severity: "hard" } }, safari: { "meta+a": { action: "Select all", severity: "hard" }, "meta+c": { action: "Copy", severity: "hard" }, "meta+d": { action: "Add to Reading List", severity: "hard" }, "meta+f": { action: "Find in page", severity: "hard" }, "meta+g": { action: "Find next", severity: "hard" }, "meta+j": { action: "Downloads", severity: "hard" }, "meta+l": { action: "Focus Smart Search", severity: "hard" }, "meta+n": { action: "New window", severity: "hard" }, "meta+p": { action: "Print", severity: "hard" }, "meta+r": { action: "Reload", severity: "hard" }, "meta+s": { action: "Save page", severity: "hard" }, "meta+t": { action: "New tab", severity: "hard" }, "meta+v": { action: "Paste", severity: "hard" }, "meta+w": { action: "Close tab", severity: "hard" }, "meta+x": { action: "Cut", severity: "hard" }, "meta+z": { action: "Undo", severity: "hard" }, "meta+shift+c": { action: "Inspector pick element", severity: "hard" }, "meta+shift+d": { action: "Add Reading List item", severity: "hard" }, "meta+shift+g": { action: "Find previous", severity: "find-bar-only" }, "meta+shift+h": { action: "Go to homepage", severity: "hard" }, "meta+shift+n": { action: "New private window", severity: "hard" }, "meta+shift+r": { action: "Reader mode", severity: "hard" }, "meta+shift+t": { action: "Reopen last closed tab", severity: "hard" }, "meta+shift+v": { action: "Paste as plain text", severity: "hard" }, "meta+shift+w": { action: "Close window", severity: "hard" }, "meta+shift+z": { action: "Redo", severity: "hard" }, "meta+alt+c": { action: "Web Inspector pick", severity: "hard" }, "meta+alt+i": { action: "Web Inspector", severity: "hard" } }, edge: { "meta+a": { action: "Select all", severity: "hard" }, "meta+c": { action: "Copy", severity: "hard" }, "meta+d": { action: "Save as favorite", severity: "hard" }, "meta+f": { action: "Find in page", severity: "hard" }, "meta+g": { action: "Find next", severity: "hard" }, "meta+l": { action: "Focus address bar", severity: "hard" }, "meta+n": { action: "New window", severity: "hard" }, "meta+o": { action: "Open file", severity: "hard" }, "meta+p": { action: "Print", severity: "hard" }, "meta+r": { action: "Reload", severity: "hard" }, "meta+s": { action: "Save page", severity: "hard" }, "meta+t": { action: "New tab", severity: "hard" }, "meta+v": { action: "Paste", severity: "hard" }, "meta+w": { action: "Close tab", severity: "hard" }, "meta+x": { action: "Cut", severity: "hard" }, "meta+y": { action: "History", severity: "hard" }, "meta+z": { action: "Undo", severity: "hard" }, "ctrl+m": { action: "Mute current tab", severity: "hard" }, "ctrl+meta+f": { action: "Toggle full screen", severity: "hard" }, "meta+shift+b": { action: "Favorites bar toggle", severity: "hard" }, "meta+shift+c": { action: "Developer tools", severity: "hard" }, "meta+shift+d": { action: "Favorite all tabs", severity: "hard" }, "meta+shift+e": { action: "Search in sidebar", severity: "hard" }, "meta+shift+g": { action: "Find previous", severity: "find-bar-only" }, "meta+shift+h": { action: "Home page", severity: "hard" }, "meta+shift+m": { action: "Switch user / guest", severity: "hard" }, "meta+shift+n": { action: "New InPrivate window", severity: "hard" }, "meta+shift+r": { action: "Hard reload", severity: "hard" }, "meta+shift+t": { action: "Reopen closed tab", severity: "hard" }, "meta+shift+u": { action: "Read Aloud toggle", severity: "hard" }, "meta+shift+v": { action: "Paste as plain text", severity: "hard" }, "meta+shift+w": { action: "Close window", severity: "hard" }, "meta+shift+z": { action: "Redo", severity: "hard" }, "meta+alt+f": { action: "Search the web", severity: "hard" }, "meta+alt+j": { action: "JavaScript console", severity: "hard" }, "meta+alt+l": { action: "Downloads", severity: "hard" }, "meta+alt+m": { action: "Minimize all windows", severity: "hard" } } }, system: { "meta+space": { action: "Spotlight", severity: "os" }, "meta+tab": { action: "App switcher", severity: "os" }, "meta+h": { action: "Hide app", severity: "os" }, "meta+m": { action: "Minimize window", severity: "os" }, "meta+q": { action: "Quit app", severity: "os" }, "meta+shift+3": { action: "Screenshot full screen", severity: "os" }, "meta+shift+4": { action: "Screenshot selection", severity: "os" }, "meta+shift+5": { action: "Screen recording tool", severity: "os" }, "meta+shift+q": { action: "Log out", severity: "os" }, "meta+ctrl+q": { action: "Lock screen", severity: "os" }, "meta+ctrl+space": { action: "Character Viewer", severity: "os" }, "meta+alt+esc": { action: "Force-quit dialog", severity: "os" }, "meta+shift+slash": { action: "Help menu search (Cmd+?)", severity: "os" }, "meta+alt+h": { action: "Hide other apps", severity: "os" }, "meta+alt+d": { action: "Show or hide the Dock", severity: "os" }, "meta+backquote": { action: "Switch windows of the front app", severity: "os" } } }, windows: { browsers: { firefox: { "ctrl+a": { action: "Select all", severity: "preventable" }, "ctrl+b": { action: "Bookmarks sidebar", severity: "preventable" }, "ctrl+c": { action: "Copy", severity: "preventable" }, "ctrl+d": { action: "Bookmark this page", severity: "preventable" }, "ctrl+e": { action: "Search from page", severity: "preventable" }, "ctrl+f": { action: "Find in page", severity: "preventable" }, "ctrl+g": { action: "Find next", severity: "preventable" }, "ctrl+h": { action: "History sidebar", severity: "preventable" }, "ctrl+j": { action: "Downloads", severity: "preventable" }, "ctrl+k": { action: "Search from page", severity: "preventable" }, "ctrl+l": { action: "Focus address bar", severity: "preventable" }, "ctrl+n": { action: "New window", severity: "hard" }, "ctrl+o": { action: "Open file", severity: "preventable" }, "ctrl+p": { action: "Print", severity: "preventable" }, "ctrl+r": { action: "Reload", severity: "preventable" }, "ctrl+s": { action: "Save page", severity: "preventable" }, "ctrl+t": { action: "New tab", severity: "hard" }, "ctrl+u": { action: "View source", severity: "preventable" }, "ctrl+v": { action: "Paste", severity: "preventable" }, "ctrl+w": { action: "Close tab", severity: "hard" }, "ctrl+x": { action: "Cut", severity: "preventable" }, "ctrl+y": { action: "Redo", severity: "preventable" }, "ctrl+z": { action: "Undo", severity: "preventable" }, "ctrl+shift+a": { action: "Add-ons manager", severity: "hard" }, "ctrl+shift+b": { action: "Bookmarks toolbar", severity: "hard" }, "ctrl+shift+c": { action: "Inspector (element picker)", severity: "hard" }, "ctrl+shift+d": { action: "Bookmark all tabs", severity: "hard" }, "ctrl+shift+e": { action: "Network Monitor", severity: "hard" }, "ctrl+shift+g": { action: "Find previous", severity: "find-bar-only" }, "ctrl+shift+i": { action: "Developer Tools", severity: "hard" }, "ctrl+shift+j": { action: "Browser Console", severity: "hard" }, "ctrl+shift+k": { action: "Web Console", severity: "hard" }, "ctrl+shift+m": { action: "Responsive Design Mode", severity: "hard" }, "ctrl+shift+n": { action: "New private window", severity: "hard" }, "ctrl+shift+o": { action: "Bookmarks library", severity: "hard" }, "ctrl+shift+p": { action: "New private window (alt)", severity: "hard" }, "ctrl+shift+s": { action: "Firefox Screenshot", severity: "hard" }, "ctrl+shift+t": { action: "Reopen closed tab", severity: "hard" }, "ctrl+shift+v": { action: "Paste as plain text", severity: "hard" }, "ctrl+shift+w": { action: "Close window", severity: "hard" }, "ctrl+shift+y": { action: "Downloads (alt)", severity: "hard" }, "ctrl+shift+z": { action: "Debugger", severity: "hard" }, "alt+f": { action: "File menu", severity: "menu-activation" }, "alt+e": { action: "Edit menu", severity: "menu-activation" }, "alt+v": { action: "View menu", severity: "menu-activation" }, "alt+b": { action: "Bookmarks menu", severity: "menu-activation" }, "alt+t": { action: "Tools menu", severity: "menu-activation" }, "alt+h": { action: "Help menu", severity: "menu-activation" }, "alt+d": { action: "Focus address bar", severity: "hard" } }, chrome: { "ctrl+a": { action: "Select all", severity: "preventable" }, "ctrl+c": { action: "Copy", severity: "preventable" }, "ctrl+d": { action: "Bookmark this page", severity: "preventable" }, "ctrl+e": { action: "Search from page", severity: "preventable" }, "ctrl+f": { action: "Find in page", severity: "preventable" }, "ctrl+g": { action: "Find next", severity: "preventable" }, "ctrl+h": { action: "History page", severity: "preventable" }, "ctrl+j": { action: "Downloads", severity: "preventable" }, "ctrl+k": { action: "Search from page", severity: "preventable" }, "ctrl+l": { action: "Focus address bar", severity: "preventable" }, "ctrl+n": { action: "New window", severity: "hard" }, "ctrl+o": { action: "Open file", severity: "preventable" }, "ctrl+p": { action: "Print", severity: "preventable" }, "ctrl+r": { action: "Reload", severity: "preventable" }, "ctrl+s": { action: "Save page", severity: "preventable" }, "ctrl+t": { action: "New tab", severity: "hard" }, "ctrl+u": { action: "View source", severity: "preventable" }, "ctrl+v": { action: "Paste", severity: "preventable" }, "ctrl+w": { action: "Close tab", severity: "hard" }, "ctrl+x": { action: "Cut", severity: "preventable" }, "ctrl+z": { action: "Undo", severity: "preventable" }, "ctrl+shift+b": { action: "Bookmarks bar toggle", severity: "hard" }, "ctrl+shift+d": { action: "Bookmark all tabs", severity: "hard" }, "ctrl+shift+g": { action: "Find previous", severity: "find-bar-only" }, "ctrl+shift+i": { action: "DevTools", severity: "hard" }, "ctrl+shift+j": { action: "DevTools (console)", severity: "hard" }, "ctrl+shift+m": { action: "Switch user / guest", severity: "hard" }, "ctrl+shift+n": { action: "Incognito window", severity: "hard" }, "ctrl+shift+r": { action: "Hard reload", severity: "hard" }, "ctrl+shift+t": { action: "Reopen closed tab", severity: "hard" }, "ctrl+shift+v": { action: "Paste as plain text", severity: "hard" }, "ctrl+shift+w": { action: "Close window", severity: "hard" }, "alt+d": { action: "Focus address bar", severity: "hard" }, "alt+e": { action: "Customize menu", severity: "menu-activation" }, "alt+f": { action: "Customize menu (alt)", severity: "menu-activation" } }, edge: { "ctrl+a": { action: "Select all", severity: "preventable" }, "ctrl+c": { action: "Copy", severity: "preventable" }, "ctrl+d": { action: "Favorite this page", severity: "preventable" }, "ctrl+e": { action: "Search from page", severity: "preventable" }, "ctrl+f": { action: "Find in page", severity: "preventable" }, "ctrl+g": { action: "Find next", severity: "preventable" }, "ctrl+h": { action: "History", severity: "preventable" }, "ctrl+j": { action: "Downloads", severity: "preventable" }, "ctrl+k": { action: "Search from page", severity: "preventable" }, "ctrl+l": { action: "Focus address bar", severity: "preventable" }, "ctrl+m": { action: "Mute current tab", severity: "preventable" }, "ctrl+n": { action: "New window", severity: "hard" }, "ctrl+o": { action: "Open file", severity: "preventable" }, "ctrl+p": { action: "Print", severity: "preventable" }, "ctrl+r": { action: "Reload", severity: "preventable" }, "ctrl+s": { action: "Save page", severity: "preventable" }, "ctrl+t": { action: "New tab", severity: "hard" }, "ctrl+u": { action: "View source", severity: "preventable" }, "ctrl+v": { action: "Paste", severity: "preventable" }, "ctrl+w": { action: "Close tab", severity: "hard" }, "ctrl+x": { action: "Cut", severity: "preventable" }, "ctrl+z": { action: "Undo", severity: "preventable" }, "ctrl+shift+b": { action: "Favorites bar toggle", severity: "hard" }, "ctrl+shift+d": { action: "Bookmark all tabs in folder", severity: "hard" }, "ctrl+shift+e": { action: "Search in sidebar", severity: "hard" }, "ctrl+shift+g": { action: "Find previous", severity: "find-bar-only" }, "ctrl+shift+i": { action: "DevTools", severity: "hard" }, "ctrl+shift+j": { action: "DevTools (console)", severity: "hard" }, "ctrl+shift+k": { action: "Duplicate tab", severity: "hard" }, "ctrl+shift+l": { action: "Paste and search", severity: "hard" }, "ctrl+shift+m": { action: "Switch user / guest", severity: "hard" }, "ctrl+shift+n": { action: "InPrivate window", severity: "hard" }, "ctrl+shift+o": { action: "Open favorites", severity: "hard" }, "ctrl+shift+p": { action: "Print (system dialog)", severity: "hard" }, "ctrl+shift+r": { action: "Hard reload", severity: "hard" }, "ctrl+shift+t": { action: "Reopen closed tab", severity: "hard" }, "ctrl+shift+u": { action: "Read Aloud toggle", severity: "hard" }, "ctrl+shift+v": { action: "Paste without formatting", severity: "hard" }, "ctrl+shift+w": { action: "Close window", severity: "hard" }, "ctrl+shift+y": { action: "Collections", severity: "hard" }, "alt+d": { action: "Focus address bar", severity: "hard" }, "alt+e": { action: "Settings menu", severity: "menu-activation" }, "alt+f": { action: "Settings menu (alt)", severity: "menu-activation" }, "alt+shift+b": { action: "Focus favorites bar", severity: "hard" }, "alt+shift+i": { action: "Send feedback dialog", severity: "hard" }, "alt+shift+t": { action: "Focus app bar toolbar", severity: "hard" } } }, system: { "meta+a": { action: "Action Center", severity: "os" }, "meta+c": { action: "Windows search", severity: "os" }, "meta+d": { action: "Show desktop", severity: "os" }, "meta+e": { action: "File Explorer", severity: "os" }, "meta+g": { action: "Game bar", severity: "os" }, "meta+h": { action: "Voice dictation", severity: "os" }, "meta+i": { action: "Settings", severity: "os" }, "meta+l": { action: "Lock", severity: "os" }, "meta+n": { action: "Notification center", severity: "os" }, "meta+p": { action: "Project / display mode", severity: "os" }, "meta+r": { action: "Run dialog", severity: "os" }, "meta+s": { action: "Search", severity: "os" }, "meta+v": { action: "Clipboard history", severity: "os" }, "meta+w": { action: "Widgets", severity: "os" }, "meta+x": { action: "Quick Link menu", severity: "os" }, "meta+z": { action: "Snap layouts", severity: "os" }, "meta+tab": { action: "Task View", severity: "os" }, "meta+shift+s": { action: "Screenshot region", severity: "os" }, "ctrl+shift+esc": { action: "Task Manager", severity: "os" }, "ctrl+alt+del": { action: "Security screen", severity: "os" }, "alt+tab": { action: "Switch windows", severity: "os" }, "alt+f4": { action: "Close active window", severity: "os" } } }, linux: { browsers: { firefox: "$ref:platforms.windows.browsers.firefox", chrome: "$ref:platforms.windows.browsers.chrome", edge: "$ref:platforms.windows.browsers.edge" }, system: { "meta+tab": { action: "Switch windows", severity: "os" }, "meta+a": { action: "Show applications", severity: "os" }, "meta+l": { action: "Lock screen", severity: "os" }, "meta+v": { action: "Notification list", severity: "os" }, "alt+tab": { action: "Switch applications", severity: "os" }, "alt+esc": { action: "Cycle windows", severity: "os" }, "alt+f2": { action: "Run command", severity: "os" }, "alt+f4": { action: "Close window", severity: "os" }, "ctrl+alt+tab": { action: "Top-bar accessibility switcher", severity: "os" }, "ctrl+alt+del": { action: "Power-off dialog", severity: "os" }, "ctrl+shift+alt+r": { action: "Toggle screencast recording", severity: "os" } } } } };
640
9
 
641
10
  // reservations.js
11
+ import { lookupKey, readHotkey } from "./parse.js";
12
+ import { detectPlatform, detectBrowser } from "./platform.js";
642
13
  var SUPPORTED_SCHEMA = "1.0";
643
14
  var HARD_SEVERITIES = /* @__PURE__ */ new Set(["hard", "os", "menu-activation"]);
644
15
  var SOFT_SEVERITIES = /* @__PURE__ */ new Set(["find-bar-only", "compose", "system-text", "devtools-open", "preventable"]);
@@ -716,34 +87,6 @@ function severityIsHard(severity) {
716
87
  function severityIsSoft(severity) {
717
88
  return SOFT_SEVERITIES.has(severity);
718
89
  }
719
- function formatReservationWarning(reservation, rawHotkey, bindOptions) {
720
- const where = platformLabel(reservation.platform);
721
- const sourceLabel = reservation.source === "browser" ? `${reservation.browser} on ${where}` : where;
722
- const tag = severityIsHard(reservation.severity) ? "will not fire" : reservation.severity === "preventable" ? bindOptions?.preventDefault ? "fires first; preventDefault keeps the browser out" : "fires, and the browser acts too; bind with preventDefault: true" : "fires in normal browsing";
723
- return `[hotkey-router] "${rawHotkey}" (${reservation.lookupKey}) reserved by ${sourceLabel}: "${reservation.action}" [${reservation.severity}] \u2014 ${tag}.`;
724
- }
725
- function emitReservationWarning(reservation, rawHotkey, console_ = console, bindOptions) {
726
- const msg = formatReservationWarning(reservation, rawHotkey, bindOptions);
727
- const loud = severityIsHard(reservation.severity) || reservation.severity === "preventable" && !bindOptions?.preventDefault;
728
- const fn = loud ? console_.warn : console_.info;
729
- fn.call(console_, msg);
730
- }
731
- function installReservationWarnings(hotkeys, opts = {}) {
732
- if (!hotkeys || typeof hotkeys.onBind !== "function") {
733
- throw new TypeError(
734
- "installReservationWarnings(hotkeys) requires a hotkey-router instance with onBind() (>= v0.2.0)"
735
- );
736
- }
737
- const platform = opts.platform !== void 0 ? opts.platform : detectPlatform();
738
- const browser = opts.browser !== void 0 ? opts.browser : detectBrowser();
739
- const console_ = opts.console || console;
740
- return hotkeys.onBind(({ combo, raw, options }) => {
741
- if (options?.warnOnReserved === false) return;
742
- if (!platform || !browser) return;
743
- const reservation = lookupReservation(combo, { platform, browser });
744
- if (reservation) emitReservationWarning(reservation, raw, console_, options);
745
- });
746
- }
747
90
  var SCHEMA_VERSION = browser_hotkeys_default?.version?.schema;
748
91
  var DATA_GENERATED = browser_hotkeys_default?.version?.generated;
749
92
  var BUNDLED_DATA = browser_hotkeys_default;
@@ -753,9 +96,6 @@ export {
753
96
  SCHEMA_VERSION,
754
97
  detectBrowser,
755
98
  detectPlatform,
756
- emitReservationWarning,
757
- formatReservationWarning,
758
- installReservationWarnings,
759
99
  lookupKeyFromCombo,
760
100
  lookupReservation,
761
101
  severityIsHard,