From db603a4c663f621d187df4497e71a01f6fecd39b Mon Sep 17 00:00:00 2001 From: varjolintu Date: Tue, 12 Sep 2017 15:27:18 +0300 Subject: [PATCH] Fix for popup with polyfill --- keepassxc-browser/background/page.js | 9 +++++++++ 1 file changed, 9 insertions(+) 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]); + }); }); }