use array destructure to query browser tab on startup

This commit is contained in:
contributor
2025-11-19 00:00:12 +02:00
parent 96985fa3c2
commit c8258070c8
+3 -3
View File
@@ -338,9 +338,9 @@ browser.tabs.onUpdated.addListener(async (tabId, changeInfo) => {
// On extension startup - check current tab
(async () => {
const tabs = await browser.tabs.query({ active: true, currentWindow: true });
if (tabs[0]?.url && tabs[0].id !== undefined) {
await checkAndUpdateTab(tabs[0].id);
const [tab] = await browser.tabs.query({ active: true, currentWindow: true });
if (tab?.id) {
await checkAndUpdateTab(tab.id);
}
})();