mirror of
https://github.com/linkwarden/browser-extension.git
synced 2026-06-23 04:10:26 +00:00
update checkmark state on tabs.onUpdated event
only load on complete https://github.com/contributor/self-hosted-linkwarden-extension/pull/2#discussion_r2539167168
This commit is contained in:
@@ -324,10 +324,18 @@ async function checkAndUpdateTab(tabId) {
|
||||
}
|
||||
}
|
||||
|
||||
// Listen for tab switches (to update icon for already-loaded tabs)
|
||||
browser.tabs.onActivated.addListener(async ({ tabId }) => {
|
||||
await checkAndUpdateTab(tabId);
|
||||
});
|
||||
|
||||
// Listen for URL changes (navigation, page loads)
|
||||
browser.tabs.onUpdated.addListener(async (tabId, changeInfo) => {
|
||||
if (changeInfo.status === 'complete') {
|
||||
await checkAndUpdateTab(tabId);
|
||||
}
|
||||
});
|
||||
|
||||
// Omnibox implementation
|
||||
|
||||
browser.omnibox.onInputStarted.addListener(async () => {
|
||||
|
||||
Reference in New Issue
Block a user