Add support for reload extension shortcut

This commit is contained in:
varjolintu 2021-10-18 07:54:58 +03:00
parent 570bfc68e0
commit 2b246a2bef
3 changed files with 7 additions and 1 deletions

View file

@ -146,7 +146,8 @@ browser.commands.onCommand.addListener(async (command) => {
if (contextMenuItems.some(e => e.action === command)
|| command === 'redetect_fields'
|| command === 'choose_credential_fields'
|| command === 'retrive_credentials_forced') {
|| command === 'retrive_credentials_forced'
|| command === 'reload_extension') {
const tabs = await browser.tabs.query({ active: true, currentWindow: true });
if (tabs.length) {
browser.tabs.sendMessage(tabs[0].id, { action: command });

View file

@ -2108,6 +2108,8 @@ browser.runtime.onMessage.addListener(async function(req, sender) {
kpxc.inputs = [];
kpxc.combinations = [];
kpxc.initCredentialFields();
} else if (req.action === 'reload_extension') {
sendMessage('reconnect');
} else if (req.action === 'save_credentials') {
kpxc.rememberCredentialsFromContextMenu();
} else if (req.action === 'retrive_credentials_forced') {

View file

@ -111,6 +111,9 @@
},
"request_autotype": {
"description": "__MSG_contextMenuRequestGlobalAutoType__"
},
"reload_extension": {
"description": "__MSG_popupReloadButton__"
}
},
"web_accessible_resources": [