mirror of
https://github.com/bitwarden/browser.git
synced 2024-12-21 16:18:28 +01:00
added hotkey commands to launch browser action popup and generate new password
This commit is contained in:
parent
71e92d83f8
commit
691d2625d7
@ -11,6 +11,15 @@ var autofillService = new AutofillService();
|
||||
var passwordGenerationService = new PasswordGenerationService();
|
||||
var appIdService = new AppIdService();
|
||||
|
||||
chrome.commands.onCommand.addListener(function (command) {
|
||||
if (command === 'generate_password') {
|
||||
passwordGenerationService.getOptions().then(function (options) {
|
||||
var password = passwordGenerationService.generatePassword(options);
|
||||
copyToClipboard(password);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
chrome.runtime.onMessage.addListener(function (msg, sender, sendResponse) {
|
||||
if (msg.command === 'loggedOut') {
|
||||
setIcon(true);
|
||||
|
@ -65,6 +65,21 @@
|
||||
"http://*/*",
|
||||
"https://*/*"
|
||||
],
|
||||
"commands": {
|
||||
"generate_password": {
|
||||
"suggested_key": {
|
||||
"default": "Ctrl+Shift+O",
|
||||
"mac": "Command+Shift+O"
|
||||
},
|
||||
"description": "Generate and copy a new random password to the clipboard."
|
||||
},
|
||||
"_execute_browser_action": {
|
||||
"suggested_key": {
|
||||
"default": "Ctrl+Shift+Y",
|
||||
"mac": "Command+Shift+Y"
|
||||
}
|
||||
}
|
||||
},
|
||||
"web_accessible_resources": [
|
||||
"overlay/popup.html"
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user