(reason)
| 541 | } |
| 542 | |
| 543 | async function pushTabState(reason) { |
| 544 | const snapshot = await snapshotTabs(); |
| 545 | if (!snapshot) return; |
| 546 | chrome.runtime.sendMessage({ |
| 547 | type: 'browserTabState', |
| 548 | reason, |
| 549 | ...snapshot, |
| 550 | }).catch(() => {}); // expected: sidepanel may not be open |
| 551 | } |
| 552 | |
| 553 | chrome.tabs.onActivated.addListener((activeInfo) => { |
| 554 | // Keep the legacy event for any consumer still listening to it (the chat |
no test coverage detected