Restricted page credentials polling to active tab

This commit is contained in:
varjolintu 2017-10-20 08:58:15 +03:00
parent aec3aa2314
commit 7270acf8d9
2 changed files with 28 additions and 22 deletions

View file

@ -1,3 +1,7 @@
0.3.6 (20-10-2017)
=========================
- Restricted page credentials polling to active tab
0.3.5 (19-10-2017)
=========================
- Removed database locked/unlocked status polling and replaced it with message handling from KeePassXC signals

View file

@ -1132,32 +1132,34 @@ cip.detectNewActiveFields = function() {
// Switch credentials if database is changed or closed
cip.detectDatabaseChange = function() {
const dbDetectInterval = setInterval(function() {
browser.runtime.sendMessage({
action: 'check_databasehash'
}).then((response) => {
if (response.new === 'no-hash') {
cipEvents.clearCredentials();
if (document.visibilityState !== 'hidden') {
browser.runtime.sendMessage({
action: 'check_databasehash'
}).then((response) => {
if (response.new === 'no-hash') {
cipEvents.clearCredentials();
browser.runtime.sendMessage({
action: 'page_clear_logins'
});
// Switch back to default popup
browser.runtime.sendMessage({
action: 'get_status'
});
} else {
if (response.new !== 'no-hash' && response.new !== response.old) {
browser.runtime.sendMessage({
action: 'get_settings',
}).then((response) => {
cip.settings = response.data;
cip.initCredentialFields(true);
action: 'page_clear_logins'
});
// Switch back to default popup
browser.runtime.sendMessage({
action: 'get_status'
});
} else {
if (response.new !== 'no-hash' && response.new !== response.old) {
browser.runtime.sendMessage({
action: 'get_settings',
}).then((response) => {
cip.settings = response.data;
cip.initCredentialFields(true);
});
}
}
}
});
}, 1000);
});
}
}, 2000);
};
cip.initCredentialFields = function(forceCall) {