diff --git a/dist/manifest_chromium.json b/dist/manifest_chromium.json index 93a1d4e..e0448be 100755 --- a/dist/manifest_chromium.json +++ b/dist/manifest_chromium.json @@ -124,6 +124,9 @@ "request_autotype": { "description": "__MSG_contextMenuRequestGlobalAutoType__" }, + "reopen_database": { + "description": "__MSG_popupReopenButton__" + }, "reload_extension": { "description": "__MSG_popupReloadButton__" } diff --git a/dist/manifest_firefox.json b/dist/manifest_firefox.json index 1a4d993..d4f8d4a 100644 --- a/dist/manifest_firefox.json +++ b/dist/manifest_firefox.json @@ -137,6 +137,9 @@ "request_autotype": { "description": "__MSG_contextMenuRequestGlobalAutoType__" }, + "reopen_database": { + "description": "__MSG_popupReopenButton__" + }, "reload_extension": { "description": "__MSG_popupReloadButton__" } diff --git a/keepassxc-browser/background/init.js b/keepassxc-browser/background/init.js index e584956..050bfe7 100644 --- a/keepassxc-browser/background/init.js +++ b/keepassxc-browser/background/init.js @@ -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); - } + } } }; diff --git a/keepassxc-browser/content/keepassxc-browser.js b/keepassxc-browser/content/keepassxc-browser.js index 5a16bc2..f7ea8be 100755 --- a/keepassxc-browser/content/keepassxc-browser.js +++ b/keepassxc-browser/content/keepassxc-browser.js @@ -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') { diff --git a/keepassxc-browser/manifest.json b/keepassxc-browser/manifest.json index 93a1d4e..e0448be 100755 --- a/keepassxc-browser/manifest.json +++ b/keepassxc-browser/manifest.json @@ -124,6 +124,9 @@ "request_autotype": { "description": "__MSG_contextMenuRequestGlobalAutoType__" }, + "reopen_database": { + "description": "__MSG_popupReopenButton__" + }, "reload_extension": { "description": "__MSG_popupReloadButton__" }