diff --git a/keepassxc-browser/background/browserAction.js b/keepassxc-browser/background/browserAction.js index 4f8e7ac..ca42b5d 100755 --- a/keepassxc-browser/background/browserAction.js +++ b/keepassxc-browser/background/browserAction.js @@ -21,7 +21,7 @@ browserAction.show = function(callback, tab) { browser.browserAction.setIcon({ tabId: tab.id, - path: '/icons/19x19/' + browserAction.generateIconName(data.iconType, data.icon) + path: '/icons/toolbar/' + browserAction.generateIconName(data.iconType, data.icon) }); if (data.popup) { @@ -65,7 +65,7 @@ browserAction.update = function(interval) { browser.browserAction.setIcon({ tabId: page.currentTabId, - path: '/icons/19x19/' + browserAction.generateIconName(null, data.intervalIcon.icons[data.intervalIcon.index]) + path: '/icons/toolbar/' + browserAction.generateIconName(null, data.intervalIcon.icons[data.intervalIcon.index]) }); } }; @@ -193,7 +193,7 @@ browserAction.removeRememberPopup = function(callback, tab, removeImmediately) { const currentMS = Date.now(); if (removeImmediately || (data.visibleForPageUpdates <= 0 && data.redirectOffset > 0)) { browserAction.stackPop(tab.id); - browserAction.show(null, { 'id': tab.id } ); + browserAction.show(null, { 'id': tab.id }); page.clearCredentials(tab.id); } else if (!isNaN(data.visibleForPageUpdates) && data.redirectOffset > 0 && currentMS >= data.redirectOffset) { data.visibleForPageUpdates -= 1; @@ -233,9 +233,9 @@ browserAction.setRememberPopup = function(tabId, username, password, url, userna index: 0, counter: 0, max: 2, - icons: ['icon_remember_red_background_19x19.png', 'icon_remember_red_lock_19x19.png'] + icons: [ 'icon_remember_red_background.png', 'icon_remember_red_lock.png' ] }, - icon: 'icon_remember_red_background_19x19.png', + icon: 'icon_remember_red_background.png', popup: 'popup_remember.html' }; @@ -301,7 +301,7 @@ browserAction.generateIconName = function(iconType, icon) { let name = 'icon_'; name += (keepass.keePassXCUpdateAvailable()) ? 'new_' : ''; name += (!iconType || iconType === 'normal') ? 'normal' : iconType; - name += '_19x19.png'; + name += '.png'; return name; }; diff --git a/keepassxc-browser/background/event.js b/keepassxc-browser/background/event.js index 17b91de..14b88e2 100755 --- a/keepassxc-browser/background/event.js +++ b/keepassxc-browser/background/event.js @@ -241,7 +241,7 @@ kpxcEvent.onLoginPopup = function(callback, tab, logins) { kpxcEvent.initHttpAuth = function(callback) { httpAuth.init(); callback(); -} +}; kpxcEvent.onHTTPAuthPopup = function(callback, tab, data) { const stackData = { diff --git a/keepassxc-browser/background/keepass.js b/keepassxc-browser/background/keepass.js index c49e6c8..1967a46 100755 --- a/keepassxc-browser/background/keepass.js +++ b/keepassxc-browser/background/keepass.js @@ -57,7 +57,7 @@ const kpErrors = { NO_URL_PROVIDED: 14, NO_LOGINS_FOUND: 15, - errorMessages : { + errorMessages: { 0: { msg: tr('errorMessageUnknown') }, 1: { msg: tr('errorMessageDatabaseNotOpened') }, 2: { msg: tr('errorMessageDatabaseHash') }, @@ -197,8 +197,8 @@ keepass.updateCredentials = function(callback, tab, entryId, username, password, }; keepass.retrieveCredentials = function(callback, tab, url, submiturl, forceCallback, triggerUnlock = false, httpAuth = false) { - keepass.testAssociation((response) => { - if (!response) { + keepass.testAssociation((taResponse) => { + if (!taResponse) { browserAction.showDefault(null, tab); if (forceCallback) { callback([]); @@ -569,7 +569,7 @@ keepass.getDatabaseHash = function(callback, tab, enableTimeout = false, trigger keepass.setcurrentKeePassXCVersion(parsed.version); keepass.databaseHash = parsed.hash || ''; - if (oldDatabaseHash && oldDatabaseHash != keepass.databaseHash) { + if (oldDatabaseHash && oldDatabaseHash !== keepass.databaseHash) { keepass.associated.value = false; keepass.associated.hash = null; } @@ -933,7 +933,7 @@ keepass.checkForNewKeePassXCVersion = function() { } if (version !== -1) { - browser.storage.local.set({'latestKeePassXC': keepass.latestKeePassXC}); + browser.storage.local.set({ 'latestKeePassXC': keepass.latestKeePassXC }); } }; @@ -944,8 +944,7 @@ keepass.checkForNewKeePassXCVersion = function() { try { xhr.open('GET', keepass.latestVersionUrl, true); xhr.send(); - } - catch (ex) { + } catch (ex) { console.log(ex); } keepass.latestKeePassXC.lastChecked = new Date().valueOf(); diff --git a/keepassxc-browser/content/autocomplete.js b/keepassxc-browser/content/autocomplete.js index a91b63c..f450c3d 100644 --- a/keepassxc-browser/content/autocomplete.js +++ b/keepassxc-browser/content/autocomplete.js @@ -22,14 +22,14 @@ kpxcAutocomplete.create = function(input, showListInstantly = false) { if (showListInstantly) { showList(input); - } + } - function showList(input) { + function showList(inputField) { closeList(); const div = kpxcUI.createElement('div', 'kpxcAutocomplete-items', { 'id': 'kpxcAutocomplete-list' }); // Element position - const rect = input.getBoundingClientRect(); + const rect = inputField.getBoundingClientRect(); div.style.top = String((rect.top + document.body.scrollTop) + input.offsetHeight) + 'px'; div.style.left = String((rect.left + document.body.scrollLeft)) + 'px'; div.style.minWidth = String(input.offsetWidth) + 'px'; @@ -48,10 +48,10 @@ kpxcAutocomplete.create = function(input, showListInstantly = false) { // Save index for combination.loginId const index = Array.prototype.indexOf.call(e.currentTarget.parentElement.childNodes, e.currentTarget); - input.value = this.getElementsByTagName('input')[0].value; - fillPassword(input.value, index); + inputField.value = this.getElementsByTagName('input')[0].value; + fillPassword(inputField.value, index); closeList(); - input.focus(); + inputField.focus(); }); // These events prevent the double hover effect if both keyboard and mouse are used @@ -71,7 +71,7 @@ kpxcAutocomplete.create = function(input, showListInstantly = false) { const items = getAllItems(); _index = 0; activateItem(items); - }; + } function activateItem(item) { if (!item || item.length === 0) { @@ -90,13 +90,13 @@ kpxcAutocomplete.create = function(input, showListInstantly = false) { if (item[_index] !== undefined) { item[_index].classList.add('kpxcAutocomplete-active'); } - }; + } function removeItem(items) { for (const item of items) { item.classList.remove('kpxcAutocomplete-active'); } - }; + } function closeList(elem) { const items = document.getElementsByClassName('kpxcAutocomplete-items'); @@ -105,7 +105,7 @@ kpxcAutocomplete.create = function(input, showListInstantly = false) { item.parentNode.removeChild(item); } } - }; + } function getAllItems() { const list = document.getElementById('kpxcAutocomplete-list'); @@ -113,7 +113,7 @@ kpxcAutocomplete.create = function(input, showListInstantly = false) { return []; } return list.getElementsByTagName('div'); - }; + } /** * Keyboard shortcuts for autocomplete menu: @@ -158,7 +158,7 @@ kpxcAutocomplete.create = function(input, showListInstantly = false) { _index = -1; showList(input); } - }; + } function fillPassword(value, index) { const fieldId = input.getAttribute('data-kpxc-id'); @@ -168,7 +168,7 @@ kpxcAutocomplete.create = function(input, showListInstantly = false) { kpxc.fillInCredentials(combination, false, false); input.setAttribute('fetched', true); - }; + } // Detect click outside autocomplete document.addEventListener('click', function(e) { diff --git a/keepassxc-browser/content/define.js b/keepassxc-browser/content/define.js index 69b0e3a..2184145 100644 --- a/keepassxc-browser/content/define.js +++ b/keepassxc-browser/content/define.js @@ -32,7 +32,7 @@ kpxcDefine.init = function() { kpxcDefine.prepareStep1(); kpxcDefine.markAllUsernameFields('#kpxcDefine-fields'); - kpxcDefine.dialog = $('#kpxcDefine-description');; + kpxcDefine.dialog = $('#kpxcDefine-description'); kpxcDefine.dialog.onmousedown = function(e) { kpxcDefine.mouseDown(e); }; @@ -205,7 +205,7 @@ kpxcDefine.markFields = function(chooser, pattern) { }; i.onfocus = function() { field.classList.add('kpxcDefine-fixed-hover-field'); - } + }; i.onblur = function() { field.classList.remove('kpxcDefine-fixed-hover-field'); }; diff --git a/keepassxc-browser/content/keepassxc-browser.js b/keepassxc-browser/content/keepassxc-browser.js index 7473c50..713bd89 100755 --- a/keepassxc-browser/content/keepassxc-browser.js +++ b/keepassxc-browser/content/keepassxc-browser.js @@ -5,7 +5,6 @@ var _called = {}; _called.retrieveCredentials = false; _called.clearLogins = false; _called.manualFillRequested = 'none'; -let _loginId = -1; let _singleInputEnabledForPage = false; const _maximumInputs = 100; @@ -77,14 +76,14 @@ browser.runtime.onMessage.addListener(function(req, sender) { kpxcDefine.init(); } else if (req.action === 'redetect_fields') { browser.runtime.sendMessage({ - action: 'load_settings', + action: 'load_settings' }).then((response) => { kpxc.settings = response; kpxc.initCredentialFields(true); }); } else if (req.action === 'show_password_generator') { kpxcPassword.trigger(); -} + } } }); @@ -344,7 +343,7 @@ kpxcFields.getCombination = function(givenType, fieldId) { return kpxcFields.combinations[0]; } - for (let c of kpxcFields.combinations) { + for (const c of kpxcFields.combinations) { if (c[givenType] === fieldId) { return c; } @@ -522,7 +521,7 @@ kpxcFields.prepareCombinations = function(combinations) { pwField.setAttribute('kpxcFields-onChange', true); pwField.onchange = function() { this.setAttribute('unchanged', false); - } + }; } // Initialize form-submit for remembering credentials @@ -699,7 +698,7 @@ kpxcObserverHelper.detectURLChange = function() { MutationObserver = window.MutationObserver || window.WebKitMutationObserver; // Detects DOM changes in the document -let observer = new MutationObserver(function(mutations, observer) { +const observer = new MutationObserver(function(mutations, obs) { if (document.visibilityState === 'hidden') { return; } @@ -737,7 +736,7 @@ observer.observe(document, { attributes: true, childList: true, characterData: true, - attributeFilter: ['style'] + attributeFilter: [ 'style' ] }); var kpxc = {}; @@ -750,7 +749,7 @@ kpxc.credentials = []; const initcb = function() { browser.runtime.sendMessage({ - action: 'load_settings', + action: 'load_settings' }).then((response) => { kpxc.settings = response; kpxc.initCredentialFields(); @@ -855,7 +854,7 @@ kpxc.initCredentialFields = function(forceCall) { // Get submitUrl for a single input if (!kpxc.submitUrl && kpxcFields.combinations.length === 1 && inputs.length === 1) { kpxc.submitUrl = kpxc.getFormActionUrlFromSingleInput(inputs[0]); - } + } if (kpxc.settings.autoRetrieveCredentials && _called.retrieveCredentials === false && (kpxc.url && kpxc.submitUrl)) { browser.runtime.sendMessage({ @@ -914,7 +913,7 @@ kpxc.retrieveCredentialsCallback = function(credentials, dontAutoFillIn) { }; kpxc.prepareFieldsForCredentials = function(autoFillInForSingle) { - // only one login for this site + // Only one login for this site if (autoFillInForSingle && kpxc.settings.autoFillSingleEntry && kpxc.credentials.length === 1) { let combination = null; if (!kpxc.p && !kpxc.u && kpxcFields.combinations.length > 0) { @@ -934,22 +933,25 @@ kpxc.prepareFieldsForCredentials = function(autoFillInForSingle) { if (combination) { let list = []; if (kpxc.fillInStringFields(combination.fields, kpxc.credentials[0].stringFields, list)) { - kpxcForm.destroy(false, {'password': list.list[0], 'username': list.list[1]}); + kpxcForm.destroy(false, { 'password': list.list[0], 'username': list.list[1] }); } } // Generate popup-list of usernames + descriptions browser.runtime.sendMessage({ action: 'popup_login', - args: [ [ kpxc.credentials[0].login + ' (' + kpxc.credentials[0].name + ')' ]] + args: [ [ kpxc.credentials[0].login + ' (' + kpxc.credentials[0].name + ')' ] ] }); + + // Auto-submit + kpxc.p.form.submit(); } else if (kpxc.credentials.length > 1 || (kpxc.credentials.length > 0 && (!kpxc.settings.autoFillSingleEntry || !autoFillInForSingle))) { kpxc.preparePageForMultipleCredentials(kpxc.credentials); } }; kpxc.preparePageForMultipleCredentials = function(credentials) { - // add usernames + descriptions to autocomplete-list and popup-list + // Add usernames + descriptions to autocomplete-list and popup-list const usernames = []; kpxcAutocomplete.elements = []; let visibleLogin; @@ -1102,7 +1104,7 @@ kpxc.fillInFromActiveElement = function(suppressWarnings, passOnly = false) { kpxc.fillInCredentials(combination, passOnly, suppressWarnings); }; -kpxc.fillInFromActiveElementTOTPOnly = function(suppressWarnings) { +kpxc.fillInFromActiveElementTOTPOnly = function() { const el = document.activeElement; kpxcFields.setUniqueId(el); const fieldId = kpxcFields.prepareId(el.getAttribute('data-kpxc-id')); diff --git a/keepassxc-browser/content/pwgen.js b/keepassxc-browser/content/pwgen.js index dff2a0a..bcf3c1e 100644 --- a/keepassxc-browser/content/pwgen.js +++ b/keepassxc-browser/content/pwgen.js @@ -35,7 +35,7 @@ kpxcPassword.observer = new IntersectionObserver((entries) => { // Wait for possible DOM animations setTimeout(() => { - kpxcPassword.setIconPosition(kpxcPassword.icon, entry.target) + kpxcPassword.setIconPosition(kpxcPassword.icon, entry.target); }, 500); } } @@ -127,7 +127,7 @@ kpxcPassword.createDialog = function() { } return; } - kpxcPassword.created = true; + kpxcPassword.created = true; const wrapper = kpxcUI.createElement('div', 'kpxc'); const dialog = kpxcUI.createElement('div', 'kpxc kpxc-pwgen-dialog'); @@ -307,8 +307,7 @@ kpxcPassword.copyPasswordToClipboard = function() { $('.kpxc-pwgen-input').select(); try { return document.execCommand('copy'); - } - catch (err) { + } catch (err) { console.log('Could not copy password to clipboard: ' + err); } return false; diff --git a/keepassxc-browser/content/ui.js b/keepassxc-browser/content/ui.js index 7b87973..3cb1306 100644 --- a/keepassxc-browser/content/ui.js +++ b/keepassxc-browser/content/ui.js @@ -1,8 +1,7 @@ 'use strict'; // jQuery style wrapper for querySelector() -var $ = function(elem) -{ +var $ = function(elem) { return document.querySelector(elem); }; @@ -35,22 +34,22 @@ kpxcUI.createElement = function(type, classes, attributes, textContent) { // Enables dragging document.onmousemove = function(e) { if (kpxcPassword.selected === kpxcPassword.titleBar) { - const x_pos = e.clientX - kpxcPassword.diffX; - const y_pos = e.clientY - kpxcPassword.diffY; + const xPos = e.clientX - kpxcPassword.diffX; + const yPos = e.clientY - kpxcPassword.diffY; if (kpxcPassword.selected !== null) { - kpxcPassword.dialog.style.left = x_pos + 'px'; - kpxcPassword.dialog.style.top = y_pos + 'px'; + kpxcPassword.dialog.style.left = xPos + 'px'; + kpxcPassword.dialog.style.top = yPos + 'px'; } } if (kpxcDefine.selected === kpxcDefine.dialog) { - const x_pos = e.clientX - kpxcDefine.diffX; - const y_pos = e.clientY - kpxcDefine.diffY; + const xPos = e.clientX - kpxcDefine.diffX; + const yPos = e.clientY - kpxcDefine.diffY; if (kpxcDefine.selected !== null) { - kpxcDefine.dialog.style.left = x_pos + 'px'; - kpxcDefine.dialog.style.top = y_pos + 'px'; + kpxcDefine.dialog.style.left = xPos + 'px'; + kpxcDefine.dialog.style.top = yPos + 'px'; } } }; diff --git a/keepassxc-browser/global.js b/keepassxc-browser/global.js index 887a290..58c29f5 100755 --- a/keepassxc-browser/global.js +++ b/keepassxc-browser/global.js @@ -40,14 +40,14 @@ var matchPatternToRegExp = function(pattern) { `^${schemeSegment}://${hostSegment}/${pathSegment}$` ); - let match = matchPatternRegExp.exec(pattern); + const match = matchPatternRegExp.exec(pattern); if (!match) { - throw new TypeError('"${pattern}" is not a valid MatchPattern'); + throw new TypeError(`"${pattern}" is not a valid MatchPattern`); } - let [, scheme, host, path] = match; + let [ , scheme, host, path ] = match; if (!host) { - throw new TypeError('"${pattern}" does not have a valid host'); + throw new TypeError(`"${pattern}" does not have a valid host`); } let regex = '^'; @@ -96,4 +96,4 @@ var slashNeededForUrl = function(pattern) { function tr(key, params) { return browser.i18n.getMessage(key, params); -}; +} diff --git a/keepassxc-browser/icons/19x19/icon_bang_19x19.png b/keepassxc-browser/icons/19x19/icon_bang_19x19.png deleted file mode 100644 index 2a7e920..0000000 Binary files a/keepassxc-browser/icons/19x19/icon_bang_19x19.png and /dev/null differ diff --git a/keepassxc-browser/icons/19x19/icon_cross_19x19.png b/keepassxc-browser/icons/19x19/icon_cross_19x19.png deleted file mode 100644 index 93caa1c..0000000 Binary files a/keepassxc-browser/icons/19x19/icon_cross_19x19.png and /dev/null differ diff --git a/keepassxc-browser/icons/19x19/icon_new_bang_19x19.png b/keepassxc-browser/icons/19x19/icon_new_bang_19x19.png deleted file mode 100644 index aed3e12..0000000 Binary files a/keepassxc-browser/icons/19x19/icon_new_bang_19x19.png and /dev/null differ diff --git a/keepassxc-browser/icons/19x19/icon_new_cross_19x19.png b/keepassxc-browser/icons/19x19/icon_new_cross_19x19.png deleted file mode 100644 index 9c0642d..0000000 Binary files a/keepassxc-browser/icons/19x19/icon_new_cross_19x19.png and /dev/null differ diff --git a/keepassxc-browser/icons/19x19/icon_new_normal_19x19.png b/keepassxc-browser/icons/19x19/icon_new_normal_19x19.png deleted file mode 100644 index 74c1335..0000000 Binary files a/keepassxc-browser/icons/19x19/icon_new_normal_19x19.png and /dev/null differ diff --git a/keepassxc-browser/icons/19x19/icon_new_questionmark_19x19.png b/keepassxc-browser/icons/19x19/icon_new_questionmark_19x19.png deleted file mode 100644 index 1633489..0000000 Binary files a/keepassxc-browser/icons/19x19/icon_new_questionmark_19x19.png and /dev/null differ diff --git a/keepassxc-browser/icons/19x19/icon_normal_19x19.png b/keepassxc-browser/icons/19x19/icon_normal_19x19.png deleted file mode 100644 index 221b1b6..0000000 Binary files a/keepassxc-browser/icons/19x19/icon_normal_19x19.png and /dev/null differ diff --git a/keepassxc-browser/icons/19x19/icon_questionmark_19x19.png b/keepassxc-browser/icons/19x19/icon_questionmark_19x19.png deleted file mode 100644 index ba14938..0000000 Binary files a/keepassxc-browser/icons/19x19/icon_questionmark_19x19.png and /dev/null differ diff --git a/keepassxc-browser/icons/19x19/icon_remember_red_background_19x19.png b/keepassxc-browser/icons/19x19/icon_remember_red_background_19x19.png deleted file mode 100644 index d38d5f7..0000000 Binary files a/keepassxc-browser/icons/19x19/icon_remember_red_background_19x19.png and /dev/null differ diff --git a/keepassxc-browser/icons/19x19/icon_remember_red_lock_19x19.png b/keepassxc-browser/icons/19x19/icon_remember_red_lock_19x19.png deleted file mode 100644 index 37da76c..0000000 Binary files a/keepassxc-browser/icons/19x19/icon_remember_red_lock_19x19.png and /dev/null differ diff --git a/keepassxc-browser/icons/toolbar/icon_bang.png b/keepassxc-browser/icons/toolbar/icon_bang.png new file mode 100644 index 0000000..18030b1 Binary files /dev/null and b/keepassxc-browser/icons/toolbar/icon_bang.png differ diff --git a/keepassxc-browser/icons/toolbar/icon_cross.png b/keepassxc-browser/icons/toolbar/icon_cross.png new file mode 100644 index 0000000..8b3ad87 Binary files /dev/null and b/keepassxc-browser/icons/toolbar/icon_cross.png differ diff --git a/keepassxc-browser/icons/toolbar/icon_new_bang.png b/keepassxc-browser/icons/toolbar/icon_new_bang.png new file mode 100644 index 0000000..b3cad15 Binary files /dev/null and b/keepassxc-browser/icons/toolbar/icon_new_bang.png differ diff --git a/keepassxc-browser/icons/toolbar/icon_new_cross.png b/keepassxc-browser/icons/toolbar/icon_new_cross.png new file mode 100644 index 0000000..adaf0cc Binary files /dev/null and b/keepassxc-browser/icons/toolbar/icon_new_cross.png differ diff --git a/keepassxc-browser/icons/toolbar/icon_new_normal.png b/keepassxc-browser/icons/toolbar/icon_new_normal.png new file mode 100644 index 0000000..56e03c4 Binary files /dev/null and b/keepassxc-browser/icons/toolbar/icon_new_normal.png differ diff --git a/keepassxc-browser/icons/toolbar/icon_new_questionmark.png b/keepassxc-browser/icons/toolbar/icon_new_questionmark.png new file mode 100644 index 0000000..9981d5b Binary files /dev/null and b/keepassxc-browser/icons/toolbar/icon_new_questionmark.png differ diff --git a/keepassxc-browser/icons/toolbar/icon_normal.png b/keepassxc-browser/icons/toolbar/icon_normal.png new file mode 100644 index 0000000..2956b93 Binary files /dev/null and b/keepassxc-browser/icons/toolbar/icon_normal.png differ diff --git a/keepassxc-browser/icons/toolbar/icon_questionmark.png b/keepassxc-browser/icons/toolbar/icon_questionmark.png new file mode 100644 index 0000000..40941a6 Binary files /dev/null and b/keepassxc-browser/icons/toolbar/icon_questionmark.png differ diff --git a/keepassxc-browser/icons/toolbar/icon_remember_red_background.png b/keepassxc-browser/icons/toolbar/icon_remember_red_background.png new file mode 100644 index 0000000..9c6c985 Binary files /dev/null and b/keepassxc-browser/icons/toolbar/icon_remember_red_background.png differ diff --git a/keepassxc-browser/icons/toolbar/icon_remember_red_lock.png b/keepassxc-browser/icons/toolbar/icon_remember_red_lock.png new file mode 100644 index 0000000..75d42ce Binary files /dev/null and b/keepassxc-browser/icons/toolbar/icon_remember_red_lock.png differ diff --git a/keepassxc-browser/options/options.js b/keepassxc-browser/options/options.js index ccf6119..903b9ab 100644 --- a/keepassxc-browser/options/options.js +++ b/keepassxc-browser/options/options.js @@ -52,7 +52,7 @@ options.saveSettingsPromise = function() { }); }); }); -} +}; options.saveSetting = function(name) { const id = '#' + name; @@ -84,7 +84,7 @@ options.saveKeyRing = function() { options.initGeneralSettings = function() { $('#tab-general-settings input[type=checkbox]').each(function() { $(this).attr('checked', options.settings[$(this).attr('name')]); - if ($(this).attr('name') === 'defaultGroupAlwaysAsk' && $(this).attr('checked')) { + if ($(this).attr('name') === 'defaultGroupAlwaysAsk' && $(this).attr('checked')) { $('#defaultGroup').prop('disabled', true); $('#defaultGroupButton').prop('disabled', true); $('#defaultGroupButtonReset').prop('disabled', true); @@ -107,7 +107,7 @@ options.initGeneralSettings = function() { $('#defaultGroupButton').prop('disabled', false); $('#defaultGroupButtonReset').prop('disabled', false); } - } else if (name == 'automaticReconnect') { + } else if (name === 'automaticReconnect') { const message = updated.automaticReconnect ? 'enable_automatic_reconnect' : 'disable_automatic_reconnect'; browser.runtime.sendMessage({ action: message }); } @@ -253,12 +253,12 @@ options.initConnectedDatabases = function() { const trClone = $('#tab-connected-databases table tr.clone:first').clone(true); trClone.removeClass('clone'); - for (let hash in options.keyRing) { + for (const hash in options.keyRing) { const tr = trClone.clone(true); tr.data('hash', hash); tr.attr('id', 'tr-cd-' + hash); - $('a.dropdown-toggle:first img:first', tr).attr('src', '/icons/19x19/icon_normal_19x19.png'); + $('a.dropdown-toggle:first img:first', tr).attr('src', '/icons/toolbar/icon_normal.png'); tr.children('td:first').text(options.keyRing[hash].id); tr.children('td:eq(1)').text(options.getPartiallyHiddenKey(options.keyRing[hash].key)); @@ -448,7 +448,7 @@ options.initSitePreferences = function() { trClone.removeClass('clone'); let counter = 1; if (options.settings['sitePreferences']) { - for (let site of options.settings['sitePreferences']) { + for (const site of options.settings['sitePreferences']) { const tr = trClone.clone(true); tr.data('url', site.url); tr.attr('id', 'tr-scf' + counter); diff --git a/keepassxc-browser/popups/popup.js b/keepassxc-browser/popups/popup.js index 1447778..f6ce0a6 100644 --- a/keepassxc-browser/popups/popup.js +++ b/keepassxc-browser/popups/popup.js @@ -57,7 +57,7 @@ $(function() { $('#reopen-database-button').click(function() { browser.runtime.sendMessage({ action: 'get_status', - args: [ false, true ] // Set forcePopup to true + args: [ false, true ] // Set forcePopup to true }).then(statusResponse); }); diff --git a/keepassxc-browser/popups/popup_httpauth.js b/keepassxc-browser/popups/popup_httpauth.js index 5072079..04732cd 100644 --- a/keepassxc-browser/popups/popup_httpauth.js +++ b/keepassxc-browser/popups/popup_httpauth.js @@ -3,7 +3,7 @@ const getLoginData = function() { return new Promise((resolve, reject) => { browser.runtime.getBackgroundPage().then((global) => { - browser.tabs.query({'active': true, 'currentWindow': true}).then((tabs) => { + browser.tabs.query({ 'active': true, 'currentWindow': true }).then((tabs) => { resolve(global.page.tabs[tabs[0].id].loginList); }); }); diff --git a/keepassxc-browser/popups/popup_remember.js b/keepassxc-browser/popups/popup_remember.js index 37cddfa..c91ed57 100644 --- a/keepassxc-browser/popups/popup_remember.js +++ b/keepassxc-browser/popups/popup_remember.js @@ -161,8 +161,8 @@ function _initialize(tab) { .attr('class', 'list-group-item') .text(_tab.credentials.list[i].login + ' (' + _tab.credentials.list[i].name + ')') .data('entryId', i) - .click(function(e) { - e.preventDefault(); + .click(function(ev) { + ev.preventDefault(); const entryId = $(this).data('entryId'); // Use the current username if it's empty @@ -189,7 +189,7 @@ function _initialize(tab) { browser.runtime.sendMessage({ action: 'update_credentials', - args: [_tab.credentials.list[entryId].uuid, _tab.credentials.username, _tab.credentials.password, _tab.credentials.url] + args: [ _tab.credentials.list[entryId].uuid, _tab.credentials.username, _tab.credentials.password, _tab.credentials.url ] }).then(_verifyResult); }); }); @@ -277,7 +277,7 @@ const getDefaultGroup = function(groups, defaultGroup) { $(function() { browser.runtime.sendMessage({ action: 'stack_add', - args: [ 'icon_remember_red_background_19x19.png', 'popup_remember.html', 10, true, 0 ] + args: [ 'icon_remember_red_background.png', 'popup_remember.html', 10, true, 0 ] }); browser.runtime.sendMessage({ diff --git a/keepassxc-browser/translate.js b/keepassxc-browser/translate.js index 0d7062e..601b92b 100644 --- a/keepassxc-browser/translate.js +++ b/keepassxc-browser/translate.js @@ -5,7 +5,7 @@ for (const item of items) { let key = item.getAttribute('data-i18n'); if (key) { let attr = ''; - [ attr, key] = trAttribute(key); + [ attr, key ] = trAttribute(key); const placeholder = item.getAttribute('i18n-placeholder'); const translation = placeholder ? browser.i18n.getMessage(key, placeholder) : browser.i18n.getMessage(key); @@ -31,4 +31,4 @@ function trAttribute(key) { } return [ attr, key ]; -}; +}