Merge pull request #358 from keepassxreboot/screen_lock_fix

Clear credentials when the screen is locked
This commit is contained in:
Sami Vänttinen 2019-03-23 09:16:39 +02:00 committed by GitHub
commit 0e80a35e62
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1424,22 +1424,26 @@ cip.init = function() {
});
};
// Clears all from the content and background scripts, including autocomplete
cip.clearAllFromPage = function() {
cipEvents.clearCredentials();
browser.runtime.sendMessage({
action: 'page_clear_logins'
});
// Switch back to default popup
browser.runtime.sendMessage({
action: 'get_status',
args: [ true ] // Set polling to true, this is an internal function call
});
};
// Switch credentials if database is changed or closed
cip.detectDatabaseChange = function(response) {
cip.clearAllFromPage();
if (document.visibilityState !== 'hidden') {
if (response.new === '' && response.old !== '') {
cipEvents.clearCredentials();
browser.runtime.sendMessage({
action: 'page_clear_logins'
});
// Switch back to default popup
browser.runtime.sendMessage({
action: 'get_status',
args: [ true ] // Set polling to true, this is an internal function call
});
} else if (response.new !== '' && response.new !== response.old) {
if (response.new !== '' && response.new !== response.old) {
_called.retrieveCredentials = false;
browser.runtime.sendMessage({
action: 'load_settings',
@ -1511,7 +1515,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 ]