Hi all,
I'm the author of Tab Nodes Tree (a Chrome extension that displays open tabs as a vertical tree in the side panel). I'm running into a fundamental limitation and wanted to ask if there's a more reliable approach than what I'm currently using.
The problem:
My extension stores a tree structure of tab nodes, keyed by Chrome tab ID and window ID. When Chrome is closed and reopened (or crashes and restores), all tab IDs are reassigned. I need to re-link the newly restored tabs back to my previously saved tree data.
Currently, I do this by matching tabs to stored tab nodes via URL comparison — exact URL first, then protocol+host at the same tab index as a fallback. This works in most cases, but fails when:
- A page's session has expired and it redirects to a login page on load
- A page changes its URL after load (e.g. redirects, SPA routing)
- Multiple tabs share the same domain
When too many tabs fail to match, the entire tree structure is lost, and the user has to rebuild it from scratch. Some users report this happening on every restart.
What I've already investigated:
- chrome.sessions.sessionId — only scoped to recently closed tabs, not cross-restart
- chrome.storage.session — cleared when Chrome closes
- chrome.runtime.onStartup — useful as a signal, but doesn't provide a stable tab identifier
- No tab.persistentId or equivalent seems to exist
My question:
Is there any Chrome extension API — current or upcoming — that provides a stable identifier for a tab that persists across browser restarts? Alternatively, is there a pattern used by other extensions to reliably associate restored tabs with previously saved custom data?
Any pointers to how session-manager-style extensions handle this would also be very appreciated.
Thanks!