diff --git a/keepassxc-browser/background/page.js b/keepassxc-browser/background/page.js index c825f59..4f82bc1 100644 --- a/keepassxc-browser/background/page.js +++ b/keepassxc-browser/background/page.js @@ -46,6 +46,15 @@ page.initOpenedTabs = function() { for (const i of tabs) { page.createTabEntry(i.id); } + + // set initial tab-ID + browser.tabs.query({ "active": true, "currentWindow": true }).then((tabs) => { + if (tabs.length === 0) { + return; // For example: only the background devtools or a popup are opened + } + page.currentTabId = tabs[0].id; + browserAction.show(null, tabs[0]); + }); }); }