Added a "copy current url" shortcut

This commit is contained in:
mr. M
2024-12-19 18:14:32 +01:00
parent 108e4a603e
commit 1f99e2547a
4 changed files with 43 additions and 3 deletions

View File

@@ -66,6 +66,7 @@ const defaultKeyboardGroups = {
'zen-search-find-again-shortcut-prev',
],
pageOperations: [
'zen-text-action-copy-url-shortcut',
'zen-location-open-shortcut',
'zen-location-open-shortcut-alt',
'zen-save-page-shortcut',
@@ -702,7 +703,7 @@ function zenGetDefaultShortcuts() {
}
class ZenKeyboardShortcutsVersioner {
static LATEST_KBS_VERSION = 5;
static LATEST_KBS_VERSION = 6;
constructor() {}
@@ -822,6 +823,21 @@ class ZenKeyboardShortcutsVersioner {
)
);
}
if (version < 6) {
// Migrate from 5 to 6
// In this new version, we add the "Copy URL" shortcut to the default shortcuts
data.push(
new KeyShortcut(
'zen-copy-url',
'C',
'',
ZEN_OTHER_SHORTCUTS_GROUP,
KeyShortcutModifiers.fromObject({ accel: true, shift: true }),
'code:gZenCommonActions.copyCurrentURLToClipboard()',
'zen-text-action-copy-url-shortcut'
)
);
}
return data;
}
}