fix: open browser popup links in managed tabs
Links requesting a new window were silently blocked. Open them in managed browser tabs with the existing session restrictions, clean up script-closed tabs, and follow click-created tabs in subsequent direct and MCP browser tools. Validation: 232 targeted tests and Windows Electron E2E passed; typecheck and lint passed. The full suite retains six failures outside the popup path. Release note: Browser links that open a new page now open in a managed tab, and AI browser actions follow the new page after a click.
This commit is contained in:
@@ -1712,6 +1712,15 @@ export class KnowledgeMcpGateway {
|
||||
browserSignal
|
||||
)
|
||||
browserSignal.throwIfAborted()
|
||||
const openedTabId = browserTools.getBoundTabId()
|
||||
if (openedTabId !== lease.tabId && capability.browserUsageLease === lease) {
|
||||
const replacement = this.browserService!.acquireTabUsage(
|
||||
capability.browserConversationId!, openedTabId, capability.requestId
|
||||
)
|
||||
capability.browserTabId = openedTabId
|
||||
capability.browserUsageLease = replacement
|
||||
lease.release()
|
||||
}
|
||||
return {
|
||||
content: result.parts.map((part) =>
|
||||
part.type === 'text'
|
||||
|
||||
Reference in New Issue
Block a user