From 41a44f7abc2aac10f3846e11998b1054c9810555 Mon Sep 17 00:00:00 2001 From: Yury Semikhatsky Date: Fri, 1 Aug 2025 17:56:47 -0700 Subject: [PATCH] chore(extension): terminate connection on debugger detach (#816) --- extension/src/relayConnection.ts | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/extension/src/relayConnection.ts b/extension/src/relayConnection.ts index 2913571..a7fd4f7 100644 --- a/extension/src/relayConnection.ts +++ b/extension/src/relayConnection.ts @@ -59,10 +59,6 @@ export class RelayConnection { this._ws.close(1000, message); } - private async _detachDebugger(): Promise { - await chrome.debugger.detach(this._debuggee); - } - private _onDebuggerEvent(source: chrome.debugger.DebuggerSession, method: string, params: any): void { if (source.tabId !== this._debuggee.tabId) return; @@ -81,13 +77,7 @@ export class RelayConnection { private _onDebuggerDetach(source: chrome.debugger.Debuggee, reason: string): void { if (source.tabId !== this._debuggee.tabId) return; - this._sendMessage({ - method: 'detachedFromTab', - params: { - tabId: this._debuggee.tabId, - reason, - }, - }); + this.close(`Debugger detached: ${reason}`); this._debuggee = { }; } @@ -131,10 +121,6 @@ export class RelayConnection { targetInfo: result?.targetInfo, }; } - if (message.method === 'detachFromTab') { - debugLog('Detaching debugger from tab:', this._debuggee); - return await this._detachDebugger(); - } if (message.method === 'forwardCDPCommand') { const { sessionId, method, params } = message.params; debugLog('CDP command:', method, params);