fix: preserve user's browser tabs on connect and newChat - #6
Open
itsbrex wants to merge 1 commit into
Open
Conversation
comet_connect and comet_ask(newChat) closed all browser tabs except one on every startup/reset, destroying the user's open tabs (commonly 100+). Instead, reuse the existing Perplexity tab via listTabsCategorized() — or open a single new tab if none exists — and never close or navigate the user's other tabs. - comet_connect: reuse Perplexity tab, else open new; report tabs preserved - comet_ask newChat: same reuse/open logic, no tab cleanup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
comet_connectandcomet_ask(withnewChat: true) call a "close all tabs except one" cleanup on every startup/reset:For anyone who keeps Comet open as their normal browser, this silently destroys their session — in my case
Connected to Perplexity (cleaned 105 old tabs)on first connect. Losing 100+ tabs to an MCP connect is a nasty surprise.Fix
Stop closing tabs. Instead:
comet_connect— reuse the existing Perplexity tab vialistTabsCategorized()(tabs.main). If there isn't one, open a single new tab. Other tabs are never touched.comet_ask(newChat) — same reuse-or-open logic, no cleanup loop.This also avoids hijacking an arbitrary tab: rather than connecting to "the first page tab" and navigating it to Perplexity, it targets the actual Perplexity tab (
tabs.main) and only creates a new tab when none exists.Notes
listTabsCategorized) instead of navigating the first available tab, so an unrelated foreground tab isn't repurposed.tsccompiles clean.