mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-28 12:45:45 +01:00
Add 'lock_vault' command (#1450)
* Update manifest.json Add additional command to lock the vault * Update shortcuts.ts add mousetrap binding for lock_vault command * Update commands.background.ts add option to lock vault with shortcut * Update messages.json add german key for lock_vault * Update messages.json add english key for 'lock_vault' command * remove commandLockVaultDesc from de message pack * Update messages.json * Update shortcuts.ts update comment for safari keybinding * Update shortcuts.ts remove confusing comment Co-authored-by: ljakobitz@dev5310.com <ljakobitz@dev5310.com> Co-authored-by: Kyle Spearrin <kspearrin@users.noreply.github.com>
This commit is contained in:
parent
62edd889f7
commit
6b6fc33b6f
@ -894,6 +894,9 @@
|
||||
"commandGeneratePasswordDesc": {
|
||||
"message": "Generate and copy a new random password to the clipboard"
|
||||
},
|
||||
"commandLockVaultDesc": {
|
||||
"message": "Lock the vault"
|
||||
},
|
||||
"privateModeMessage": {
|
||||
"message": "Unfortunately this window is not available in private mode for this browser."
|
||||
},
|
||||
|
@ -44,6 +44,9 @@ export default class CommandsBackground {
|
||||
case 'open_popup':
|
||||
await this.openPopup();
|
||||
break;
|
||||
case 'lock_vault':
|
||||
await this.vaultTimeoutService.lock(true);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -35,6 +35,10 @@ document.addEventListener('DOMContentLoaded', (event) => {
|
||||
});
|
||||
}
|
||||
|
||||
Mousetrap.bind('mod+shift+s', () => {
|
||||
sendMessage('lock_vault');
|
||||
});
|
||||
|
||||
function sendMessage(shortcut: string) {
|
||||
const msg: any = {
|
||||
command: 'keyboardShortcutTriggered',
|
||||
|
@ -118,6 +118,9 @@
|
||||
"default": "Ctrl+Shift+9"
|
||||
},
|
||||
"description": "__MSG_commandGeneratePasswordDesc__"
|
||||
},
|
||||
"lock_vault": {
|
||||
"description": "__MSG_commandLockVaultDesc__"
|
||||
}
|
||||
},
|
||||
"web_accessible_resources": [
|
||||
|
Loading…
Reference in New Issue
Block a user