diff --git a/CHANGELOG b/CHANGELOG index 6a00f0c..58e4045 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -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 diff --git a/keepassxc-browser/keepassxc-browser.js b/keepassxc-browser/keepassxc-browser.js index e3857f9..34e2b5c 100644 --- a/keepassxc-browser/keepassxc-browser.js +++ b/keepassxc-browser/keepassxc-browser.js @@ -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) {