Merge pull request #153 from keepassxreboot/credential_request_fix

Credential retrieval fix
This commit is contained in:
Janek Bevendorff 2018-05-18 10:07:42 +02:00 committed by GitHub
commit bf190d1faf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 1 deletions

View file

@ -159,6 +159,9 @@ kpxcEvent.onReconnect = function(callback, tab) {
// Add a small timeout after reconnecting. Just to make sure. It's not pretty, I know :(
setTimeout(() => {
keepass.reconnect(callback, tab).then((configured) => {
browser.tabs.sendMessage(tab.id, {
action: 'redetect_fields'
});
kpxcEvent.showStatus(configured, tab, callback);
});
}, 500);

View file

@ -839,6 +839,17 @@ keepass.onNativeMessage = function(response) {
keepass.testAssociation((associationResponse) => {
keepass.isConfigured().then((configured) => {
keepass.updatePopup(configured ? 'normal' : 'cross');
// Send message to content script
browser.tabs.query({ active: true, currentWindow: true }).then((tabs) => {
if (tabs.length) {
browser.tabs.sendMessage(tabs[0].id, {
action: 'check_database_hash',
hash: {old: keepass.previousDatabaseHash, new: keepass.databaseHash}
});
keepass.previousDatabaseHash = keepass.databaseHash;
}
});
});
}, null);
}

View file

@ -1207,6 +1207,7 @@ cip.detectDatabaseChange = function(response) {
args: [ true ] // Set polling to true, this is an internal function call
});
} else if (response.new !== 'no-hash' && response.new !== response.old) {
_called.retrieveCredentials = false;
browser.runtime.sendMessage({
action: 'load_settings',
}).then((response) => {
@ -1262,7 +1263,6 @@ cip.initCredentialFields = function(forceCall) {
}
if (cip.settings.autoRetrieveCredentials && _called.retrieveCredentials === false && (cip.url && cip.submitUrl)) {
_called.retrieveCredentials = true;
browser.runtime.sendMessage({
action: 'retrieve_credentials',
args: [ cip.url, cip.submitUrl ]