fix(extension): prevent closed borrowed tabs from blocking session stop

This commit is contained in:
drakezhang
2026-09-07 11:12:44 +08:00
parent 47ac947f18
commit e831d65db3
6 changed files with 126 additions and 8 deletions
+2 -2
View File
@@ -169,8 +169,8 @@ export default defineBackground(() => {
if (!sessions.findByWindowId(tab.windowId)) return;
void pushOverlayStateForTab(tab.id, tab.windowId);
});
chrome.tabs.onRemoved.addListener((tabId) => {
sessions.forgetAgentCreatedTab(tabId);
chrome.tabs.onRemoved.addListener((tabId, removeInfo) => {
sessions.forgetClosedTab(tabId, { isWindowClosing: removeInfo.isWindowClosing });
});
// Re-sync the storage.session flag on SW startup so a previous SW's
// stale `true` does not keep waking us on every page load until the