diff --git a/keepassxc-browser/background/browserAction.js b/keepassxc-browser/background/browserAction.js index 50e27c6..2f08f45 100755 --- a/keepassxc-browser/background/browserAction.js +++ b/keepassxc-browser/background/browserAction.js @@ -37,17 +37,9 @@ browserAction.showDefault = async function(tab) { popupData.iconType = 'locked'; } - if (page.tabs[tab.id] && page.tabs[tab.id].loginList.length > 0) { - popupData.iconType = 'questionmark'; - popupData.popup = 'popup_login'; - } - - browserAction.show(tab, popupData); -}; - -browserAction.updateIcon = async function(tab, iconType) { + // Get the current tab if no tab given if (!tab) { - const tabs = await browser.tabs.query({ 'active': true, 'currentWindow': true }); + const tabs = await browser.tabs.query({ active: true, currentWindow: true }); if (tabs.length === 0) { return; } @@ -55,9 +47,12 @@ browserAction.updateIcon = async function(tab, iconType) { tab = tabs[0]; } - browser.browserAction.setIcon({ - path: browserAction.generateIconName(iconType) - }); + if (page.tabs[tab.id] && page.tabs[tab.id].loginList.length > 0) { + popupData.iconType = 'questionmark'; + popupData.popup = 'popup_login'; + } + + browserAction.show(tab, popupData); }; browserAction.generateIconName = function(iconType) { @@ -72,7 +67,7 @@ browserAction.ignoreSite = async function(url) { await browser.windows.getCurrent(); // Get current active window - const tabs = await browser.tabs.query({ 'active': true, 'currentWindow': true }); + const tabs = await browser.tabs.query({ active: true, currentWindow: true }); const tab = tabs[0]; // Send the message to the current tab's content script diff --git a/keepassxc-browser/background/keepass.js b/keepassxc-browser/background/keepass.js index 8a5bbda..08a2d31 100755 --- a/keepassxc-browser/background/keepass.js +++ b/keepassxc-browser/background/keepass.js @@ -855,9 +855,9 @@ keepass.handleError = function(tab, errorCode, errorMessage = '') { } }; -keepass.updatePopup = function(iconType) { +keepass.updatePopup = function() { if (page && page.tabs.length > 0) { - browserAction.updateIcon(undefined, iconType); + browserAction.showDefault(); } }; @@ -868,9 +868,8 @@ keepass.updateDatabase = async function() { page.clearAllLogins(); await keepass.testAssociation(null, [ true ]); - const configured = await keepass.isConfigured(); - keepass.updatePopup(configured ? 'normal' : 'locked'); + keepass.updatePopup(); keepass.updateDatabaseHashToContent(); }; diff --git a/keepassxc-browser/popups/popup_httpauth.html b/keepassxc-browser/popups/popup_httpauth.html index 609cea7..9fb2058 100644 --- a/keepassxc-browser/popups/popup_httpauth.html +++ b/keepassxc-browser/popups/popup_httpauth.html @@ -48,7 +48,7 @@

-
+
diff --git a/keepassxc-browser/popups/popup_login.html b/keepassxc-browser/popups/popup_login.html index 8e6485c..42eb4d4 100644 --- a/keepassxc-browser/popups/popup_login.html +++ b/keepassxc-browser/popups/popup_login.html @@ -49,7 +49,7 @@

-
+