[FIX] devtools: Fix devtools in detached window

This commit fixes the issues that were happening when using the
devtools in a detached window
This commit is contained in:
Julien Carion (juca)
2023-04-13 09:21:17 +02:00
committed by Géry Debongnie
parent cca4b4bb8e
commit afd7f957df
+3 -2
View File
@@ -8,8 +8,9 @@ export async function getOwlStatus() {
}
export async function getActiveTabURL() {
const [tab] = await browserInstance.tabs.query({ active: true, lastFocusedWindow: true });
return tab.id;
const window = await browserInstance.windows.getLastFocused({ populate: true });
const activeTab = window.tabs.find((tab) => tab.active);
return activeTab.id;
}
// inspired from https://www.tutorialspoint.com/fuzzy-search-algorithm-in-javascript