Fix: Switch tab and window update (#729)

This commit is contained in:
amysteamdev
2022-07-01 17:05:55 -05:00
committed by GitHub
parent dcff87af05
commit 4da98eada4

View File

@@ -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);