(id: number, opts?: { bringToFront?: boolean })
| 816 | } |
| 817 | |
| 818 | switchTab(id: number, opts?: { bringToFront?: boolean }): void { |
| 819 | if (!this.tabSessions.has(id)) throw new Error(`Tab ${id} not found`); |
| 820 | this.activeTabId = id; |
| 821 | // Only bring to front when explicitly requested (user-initiated tab switch). |
| 822 | // Internal tab pinning (BROWSE_TAB) should NOT steal focus. |
| 823 | if (opts?.bringToFront !== false) { |
| 824 | const page = this.pages.get(id); |
| 825 | if (page) page.bringToFront().catch(() => {}); |
| 826 | } |
| 827 | } |
| 828 | |
| 829 | /** |
| 830 | * Sync activeTabId to match the tab whose URL matches the Chrome extension's |
no test coverage detected