"Reopen database" shortcut

This commit is contained in:
Aleksandr Kolbasov 2025-11-22 19:19:56 +03:00
parent 8c3df94db3
commit 855ac20ed5
5 changed files with 17 additions and 2 deletions

View file

@ -124,6 +124,9 @@
"request_autotype": {
"description": "__MSG_contextMenuRequestGlobalAutoType__"
},
"reopen_database": {
"description": "__MSG_popupReopenButton__"
},
"reload_extension": {
"description": "__MSG_popupReloadButton__"
}

View file

@ -137,6 +137,9 @@
"request_autotype": {
"description": "__MSG_contextMenuRequestGlobalAutoType__"
},
"reopen_database": {
"description": "__MSG_popupReopenButton__"
},
"reload_extension": {
"description": "__MSG_popupReloadButton__"
}

View file

@ -110,6 +110,7 @@ const initListeners = async function() {
|| command === 'redetect_fields'
|| command === 'choose_credential_fields'
|| command === 'retrive_credentials_forced'
|| command === 'reopen_database'
|| command === 'reload_extension') {
const tab = await getCurrentTab();
if (tab?.id) {
@ -172,7 +173,7 @@ const initContextMenuItems = async function() {
});
} catch (e) {
logError(e);
}
}
}
};

View file

@ -837,7 +837,7 @@ kpxc.usePredefinedSites = function(currentLocation) {
* Content script initialization.
*/
const initContentScript = async function() {
try {
try {
if (document?.documentElement?.ownerDocument?.contentType !== 'text/html'
&& document?.documentElement?.ownerDocument?.contentType !== 'application/xhtml+xml'
) {
@ -955,6 +955,11 @@ browser.runtime.onMessage.addListener(async function(req, sender) {
kpxc.initCredentialFields();
} else if (req.action === 'reload_extension') {
sendMessage('reconnect');
} else if (req.action === 'reopen_database') {
sendMessage(
'get_status',
[ false, true ] // Set forcePopup to true
);
} else if (req.action === 'save_credentials') {
kpxc.rememberCredentialsFromContextMenu();
} else if (req.action === 'retrive_credentials_forced') {

View file

@ -124,6 +124,9 @@
"request_autotype": {
"description": "__MSG_contextMenuRequestGlobalAutoType__"
},
"reopen_database": {
"description": "__MSG_popupReopenButton__"
},
"reload_extension": {
"description": "__MSG_popupReloadButton__"
}