chore(extension): do not show tab selector for browser_navigate (#923)

This commit is contained in:
Yury Semikhatsky
2025-08-22 10:02:09 -07:00
committed by GitHub
parent fb65bc7559
commit 64af5f8763
8 changed files with 52 additions and 26 deletions

View File

@@ -23,8 +23,8 @@ type PageMessage = {
type: 'getTabs';
} | {
type: 'connectToTab';
tabId: number;
windowId: number;
tabId?: number;
windowId?: number;
mcpRelayUrl: string;
} | {
type: 'getConnectionStatus';
@@ -59,7 +59,9 @@ class TabShareExtension {
(error: any) => sendResponse({ success: false, error: error.message }));
return true;
case 'connectToTab':
this._connectTab(sender.tab!.id!, message.tabId, message.windowId, message.mcpRelayUrl!).then(
const tabId = message.tabId || sender.tab?.id!;
const windowId = message.windowId || sender.tab?.windowId!;
this._connectTab(sender.tab!.id!, tabId, windowId, message.mcpRelayUrl!).then(
() => sendResponse({ success: true }),
(error: any) => sendResponse({ success: false, error: error.message }));
return true; // Return true to indicate that the response will be sent asynchronously