Skip to content

"Reopen database" shortcut#2767

Merged
varjolintu merged 3 commits into
keepassxreboot:developfrom
a2kolbasov:shortcuts-fix
Jan 4, 2026
Merged

"Reopen database" shortcut#2767
varjolintu merged 3 commits into
keepassxreboot:developfrom
a2kolbasov:shortcuts-fix

Conversation

@a2kolbasov

@a2kolbasov a2kolbasov commented Nov 22, 2025

Copy link
Copy Markdown
Contributor

Now the keyboard shortcut uses the #reopen-database-button functionality from popup.js ⇒ no credential extraction is required.

Fixes #2766

Screenshots or videos

Testing strategy

Manually

Type of change

  • ✅ Bug fix (non-breaking change that fixes an issue)
  • ✅ New feature (change that adds functionality)

@a2kolbasov

a2kolbasov commented Nov 22, 2025

Copy link
Copy Markdown
Contributor Author

// The basic function for retrieving credentials from KeePassXC.
// Credential Banner can force the retrieval for reloading new/modified credentials.
kpxc.retrieveCredentials = async function(force = false) {
if (!await isIframeAllowed()) {
return;
}
kpxc.url = document.location.href;
kpxc.submitUrl = kpxc.getFormActionUrl(kpxc.combinations[0]);
if (kpxc.settings.autoRetrieveCredentials && kpxc.url && kpxc.submitUrl) {
await kpxc.retrieveCredentialsCallback(
await sendMessage('retrieve_credentials', [ kpxc.url, kpxc.submitUrl, force ]),
);
}
};

This function is blocked by the autoRetrieveCredentials setting. If the user turned it off, then manually requested credentials, and then changed something in the database, he does not have the opportunity to request them again without updating the page.

This can be fixed by adding force || autoRetrieveCredentials. But force is also called when saving new credentials:

kpxcBanner.verifyResult = async function(code) {
if (code === 'error') {
kpxcUI.createNotification('error', tr('rememberErrorCannotSaveCredentials'));
} else if (code === 'created') {
kpxcUI.createNotification(
'success',
tr('rememberCredentialsSaved', kpxcBanner.credentials.username || tr('rememberEmptyUsername')),
);
await kpxc.retrieveCredentials(true); // Forced reload
} else if (code === 'updated') {
kpxcUI.createNotification(
'success',
tr('rememberCredentialsUpdated', kpxcBanner.credentials.username || tr('rememberEmptyUsername')),
);
await kpxc.retrieveCredentials(true); // Forced reload

Is it necessary to introduce a new function/parameter to separate the manual request from the user?

kpxc.retrieveCredentials = async function(force = false, manualRequest = false) {...}

@a2kolbasov a2kolbasov marked this pull request as ready for review November 22, 2025 20:18
@varjolintu varjolintu self-requested a review December 11, 2025 12:48
@varjolintu varjolintu added this to the 1.9.12 milestone Dec 11, 2025
@varjolintu varjolintu added the bug label Dec 11, 2025
@varjolintu

varjolintu commented Dec 11, 2025

Copy link
Copy Markdown
Member

This function is blocked by the autoRetrieveCredentials setting. If the user turned it off, then manually requested credentials, and then changed something in the database, he does not have the opportunity to request them again without updating the page.

The check should probably be:

if ((kpxc.settings.autoRetrieveCredentials || force) && kpxc.url && kpxc.submitUrl) {

But.. maybe this could be solved in another PR.

@varjolintu varjolintu merged commit 1dc3dcd into keepassxreboot:develop Jan 4, 2026
1 check passed
@a2kolbasov a2kolbasov deleted the shortcuts-fix branch January 4, 2026 19:34
@varjolintu varjolintu modified the milestones: 1.9.12, 1.10.0 Feb 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reopen database shortkey in Firefox doesn't work

2 participants