mirror of
https://github.com/linkwarden/browser-extension.git
synced 2026-06-23 04:10:26 +00:00
use array destructure to query browser tab on startup
This commit is contained in:
@@ -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);
|
||||
}
|
||||
})();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user