Merge branch 'develop'

This commit is contained in:
Janek Bevendorff 2018-05-11 10:09:48 +02:00
commit 3e45a66222
4 changed files with 23 additions and 9 deletions

View file

@ -1,3 +1,8 @@
1.1.3 (11-05-2018)
=========================
- Remove autoreconnect to prevent proxy process leakage on Windows [#147]
- Fix browser becoming unresponsive due to constant field polling [#148]
1.1.2 (10-05-2018)
=========================
- Fix credentials being requested for non-login fields [#144]

View file

@ -5,7 +5,6 @@ keepass.migrateKeyRing().then(() => {
page.initOpenedTabs().then(() => {
httpAuth.init();
keepass.connectToNative();
keepass.enableAutomaticReconnect();
keepass.generateNewKeyPair();
keepass.changePublicKeys(null).then((pkRes) => {
keepass.getDatabaseHash((gdRes) => {}, null);

View file

@ -10,6 +10,9 @@ let _loginId = -1;
// Count of detected form fields on the page
var _detectedFields = 0;
// Element id's containing input fields detected by MutationObserver
var _observerIds = [];
browser.runtime.onMessage.addListener(function(req, sender, callback) {
if ('action' in req) {
if (req.action === 'fill_user_pass_with_specific_login') {
@ -1140,13 +1143,15 @@ let observer = new MutationObserver(function(mutations, observer) {
}
for (const mut of mutations) {
if (mut.type === 'childList') {
const fields = cipFields.getAllFields();
// Check if the added element has any inputs
const inputs = mut.target.querySelectorAll(cipFields.inputQueryPattern);
// If only password field is shown it's enough to have one field visible for initCredentialFields
if (fields.length > (_detectedFields == 1 ? 0 : 1)) {
cip.initCredentialFields(true);
}
// If only password field is shown it's enough to have one field visible for initCredentialFields
const neededLength = _detectedFields === 1 ? 0 : 1;
if (inputs.length > neededLength && !_observerIds.includes(mut.target.id)) {
// Save target element id for preventing multiple calls to initCredentialsFields()
_observerIds.push(mut.target.id);
cip.initCredentialFields(true);
}
}
});
@ -1223,6 +1228,10 @@ cip.initCredentialFields = function(forceCall) {
browser.runtime.sendMessage({ 'action': 'page_clear_logins', args: [_called.clearLogins] }).then(() => {
_called.clearLogins = true;
const inputs = cipFields.getAllFields();
if (inputs.length === 0) {
return;
}
cipFields.prepareVisibleFieldsWithID('select');
cip.initPasswordGenerator(inputs);
@ -1248,6 +1257,7 @@ 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 ]

View file

@ -1,8 +1,8 @@
{
"manifest_version": 2,
"name": "KeePassXC-Browser",
"version": "1.1.2",
"version_name": "1.1.2",
"version": "1.1.3",
"version_name": "1.1.3",
"description": "KeePassXC integration for modern web browsers",
"author": "KeePassXC Team",
"icons": {