From 4da98eada44ab6db2e35e361f08343cc5ea568e6 Mon Sep 17 00:00:00 2001 From: amysteamdev <37001393+AmySteam@users.noreply.github.com> Date: Fri, 1 Jul 2022 17:05:55 -0500 Subject: [PATCH] Fix: Switch tab and window update (#729) --- tutorials/tabs-manager/popup.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tutorials/tabs-manager/popup.js b/tutorials/tabs-manager/popup.js index 794a5094..bb29e250 100644 --- a/tutorials/tabs-manager/popup.js +++ b/tutorials/tabs-manager/popup.js @@ -34,9 +34,9 @@ for (const tab of tabs) { element.querySelector(".title").textContent = title; element.querySelector(".pathname").textContent = pathname; element.querySelector("a").addEventListener("click", async () => { - // need to focus window as well as activate tab - await chrome.windows.update(tab.windowId, { focused: true }); + // need to focus window as well as the active tab await chrome.tabs.update(tab.id, { active: true }); + await chrome.windows.update(tab.windowId, { focused: true }); }); elements.add(element);