Additional keyboard shortcuts

This commit is contained in:
varjolintu 2021-03-02 16:59:26 +02:00
parent 65044321e8
commit d146b6830a
3 changed files with 14 additions and 3 deletions

View file

@ -109,7 +109,7 @@ const contextMenuItems = [
{ title: tr('contextMenuFillTOTP'), action: 'fill_totp' },
{ title: tr('contextMenuFillAttribute'), id: 'fill_attribute', visible: false },
{ title: tr('contextMenuShowPasswordGenerator'), action: 'show_password_generator' },
{ title: tr('contextMenuSaveCredentials'), action: 'remember_credentials' }
{ title: tr('contextMenuSaveCredentials'), action: 'save_credentials' }
];
const menuContexts = [ 'editable' ];
@ -137,7 +137,9 @@ for (const item of contextMenuItems) {
// Listen for keyboard shortcuts specified by user
browser.commands.onCommand.addListener(async (command) => {
if (contextMenuItems.some(e => e.action === command)) {
if (contextMenuItems.some(e => e.action === command)
|| command === 'redetect_fields'
|| command === 'choose_credential_fields') {
const tabs = await browser.tabs.query({ active: true, currentWindow: true });
if (tabs.length) {
browser.tabs.sendMessage(tabs[0].id, { action: command });

View file

@ -1899,7 +1899,7 @@ browser.runtime.onMessage.addListener(async function(req, sender) {
kpxc.inputs = [];
kpxc.combinations = [];
kpxc.initCredentialFields();
} else if (req.action === 'remember_credentials') {
} else if (req.action === 'save_credentials') {
kpxc.rememberCredentialsFromContextMenu();
} else if (req.action === 'retrive_credentials_forced') {
await kpxc.retrieveCredentials(true);

View file

@ -107,6 +107,15 @@
"default": "Alt+Shift+G",
"mac": "MacCtrl+Shift+G"
}
},
"save_credentials": {
"description": "__MSG_contextMenuSaveCredentials__"
},
"redetect_fields": {
"description": "__MSG_popupRedetectButton__"
},
"choose_credential_fields": {
"description": "__MSG_popupChooseCredentialsText__"
}
},
"web_accessible_resources": [