mirror of
https://github.com/keepassxreboot/keepassxc-browser.git
synced 2026-03-11 08:54:43 +00:00
Merge pull request #358 from keepassxreboot/screen_lock_fix
Clear credentials when the screen is locked
This commit is contained in:
commit
0e80a35e62
1 changed files with 17 additions and 14 deletions
|
|
@ -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 ]
|
||||
|
|
|
|||
Loading…
Reference in a new issue